def getRootPackagePath(module, finder=imp.find_module, loader=imp.load_module):
    """ Gets the top-level path that contains a module. This path should be in the python path."""
    
    packageName = module.__name__
    if '.' in packageName:
        packageName,tail = module.__name__.split('.', 1)
     
    package = importObject(packageName, finder=finder, loader=loader)
    packagePath, = package.__path__
    return os.path.dirname(packagePath)
dataset/ETHPy150Open joehewitt/devon/devon/importing.py/getRootPackagePath/original