Return an array of tuples with the name and path for
    repositories found in a directory.

    :param str path:
        The path to find repositories in
    :returns: tuple
500895
def get_repositories(path):
    
    return [get_repository(os.path.join(path, subdir))
            for subdir in os.listdir(path)
            if os.path.isdir(
            os.path.join(path, subdir, '.git'))]
1114106
def list_dir_abspath(path):
    
    return map(lambda f: os.path.join(path, f), os.listdir(path))
1292369
def _get_file_paths(cur):
    
    out = []
    if isinstance(cur, (list, tuple)):
        for x in cur:
            new = _get_file_paths(x)
            if new:
                out.extend(new)
    elif isinstance(cur, dict):
        if "class" in cur:
            out.append(cur["path"])
        else:
            for k, v in cur.items():
                new = _get_file_paths(v)
                if new:
                    out.extend(new)
    return out
601974
def extract_paths(self, paths, *args, **kwargs):
        
        return self.provider.extract_paths(paths, *args, **kwargs)
1093398
def find_repo_root_by_path(path):
    """"""
    repo = git.Repo(path, search_parent_directories=True)
    repo_path = repo.git.rev_parse('--show-toplevel')
    logging.info('Repository: {}'.format(repo_path))
    return repo_path
793776
def get_includes(self, path):
        
        config = self.file_index.unfold_yaml(path)

        return self.get_includes_from_dict(config, extract=True)
367681
def find_packages_under(path):
    
    all_packages = setuptools.find_packages()
    packages = []
    for package in all_packages:
        package_split = package.split(".")
        if package_split[0] == path:
            packages.append(package)
    return packages
611941
def path_parts(path):
    
    path = path if path is not None else ''
    container_path = object_path = ''
    parts = path_list(path)

    if len(parts) >= 1:
        container_path = parts[0]
    if len(parts) > 1:
        object_path = path_join(*parts[1:])

    return container_path, object_path
657114
def build(cls, path):
        
        with zipfile.ZipFile(path) as zfile:
            items = (
                (
                    name.replace('/', os.sep),
                    zfile.getinfo(name),
                )
                for name in zfile.namelist()
            )
            return dict(items)
870097
def get_path_signature(self, path):
        
        if not os.path.exists(path):
            return None
        if os.path.isdir(path):
            merge = {}
            for root, dirs, files in os.walk(path):
                for name in files:
                    full_name = os.path.join(root, name)
                    merge[full_name] = os.stat(full_name)
            return merge
        else:
            return os.stat(path)
306408
def listdir_find_repos(where):
    
    stack = deque([(convert_path(where), '')])
    while stack:
        where, prefix = stack.pop()
        try:
            for name in sorted(os.listdir(where), reverse=True):
                fn = os.path.join(where, name)
                if name in REPO_PREFIXES:
                    if 1:  # os.path.exists(fn):
                        # yield name[1:], fn.rstrip(name)[:-1] # abspath
                        repo = REPO_PREFIXES[name](fn.rstrip(name)[:-1])
                        yield repo
                    stack.append((fn, prefix + name + '/'))
        except OSError as e:
            if e.errno == errno.EACCES:
                log.error("Skipping: %s", e)
            else:
                raise
582979
def _get_path(dict_, path):
    '''
    
    '''
    cur = dict_
    for part in path.split('/'):
        cur = cur[part]
    return cur
748053
def _get_module_folders(self, temp_repo):
        
        paths = (
            os.path.join(temp_repo, path) for path in os.listdir(temp_repo)
            if self._is_module_included(path)
        )
        return (path for path in paths if os.path.isdir(path))
832286
def _complete_path(path=None):
    
    if not path:
        return _listdir('.')
    dirname, rest = os.path.split(path)
    tmp = dirname if dirname else '.'
    res = [p for p in _listdir(tmp) if p.startswith(rest)]
    # more than one match, or single match which does not exist (typo)
    if len(res) > 1 or not os.path.exists(path):
        return res
    # resolved to a single directory, so return list of files below it
    if os.path.isdir(path):
        return [p for p in _listdir(path)]
    # exact file match terminates this completion
    return [path + ' ']
1047854
def get(path)
      tmp = Rudy::Backup.new path
      backups = Rudy::Backups.list :path => path
      return nil unless backups.is_a?(Array) && !backups.empty?
      backups.first
    end
618530
def path_components(path):
    
    components = []
    # The loop guarantees that the returned components can be
    # os.path.joined with the path separator and point to the same
    # location:    
    while True:
        (new_path, tail) = os.path.split(path)  # Works on any platform
        components.append(tail)        
        if new_path == path:  # Root (including drive, on Windows) reached
            break
        path = new_path
    components.append(new_path)    
    components.reverse()  # First component first 
    return components
1107972
def get_repo_paths(path):
    
    repo_paths = []
    dirnames = (os.path.abspath(dirname) for dirname in os.listdir(path))
    for dirname in dirnames:
        try:
            get_scm(dirname)
            repo_paths.append(dirname)
        except VCSError:
            pass
    return repo_paths