

def to_module(path):
    path = os.path.relpath(path)
    if path.startswith('..'):
        raise DiscoveryError('Test outside of current directory')
    path = path.replace(os.sep, '.')
    path_parts = path.split('.')
    if (path_parts[(- 1)] == 'py'):
        path.pop()
    return '.'.join(path_parts)

dataset/ETHPy150Open Yelp/Testify/testify/test_discovery.py to_module/VarMisuse@75/96 `path_parts`->`path`