Return an ordered list of the `Chain_#` directories in the db
        directory.
344454
def get_chains(self):
        """"""
        chains = []
        try:
            content = os.listdir(self._directory)
            for c in content:
                if os.path.isdir(os.path.join(self._directory, c)) and c.startswith(
                        CHAIN_NAME[:-2]):
                    chains.append(c)
        except:
            pass
        chains.sort()
        return chains
1133798
def dirs(self):
        """"""
        contents = self.paths
        contents = (VenvDir(path.path) for path in contents if path.is_dir)
        return contents
1254247
def directory_listing(conn: FTP, path: str) -> Tuple[List, List]:
    """"""

    entries = deque()
    conn.dir(path, entries.append)
    entries = map(parse_line, entries)
    grouped_entries = defaultdict(list)

    for key, value in entries:
        grouped_entries[key].append(value)

    directories = grouped_entries[ListingType.directory]
    files = grouped_entries[ListingType.file]

    return directories, files
420627
def listdir(path, include=r'.', exclude=r'\.pyc$|^\.', show_all=False,
            folders_only=False):
    """"""
    namelist = []
    dirlist = [to_text_string(osp.pardir)]
    for item in os.listdir(to_text_string(path)):
        if re.search(exclude, item) and not show_all:
            continue
        if osp.isdir(osp.join(path, item)):
            dirlist.append(item)
        elif folders_only:
            continue
        elif re.search(include, item) or show_all:
            namelist.append(item)
    return sorted(dirlist, key=str_lower) + \
           sorted(namelist, key=str_lower)
1350516
def get_subdirectories(directory):
    
    return [name for name in os.listdir(directory)
            if name != '__pycache__'
            if os.path.isdir(os.path.join(directory, name))]
745169
def dirs(self):
        """"""
        contents = self.paths
        contents = (BinDir(path.path) for path in contents if path.is_dir)
        return contents
1268540
private List<String> getChainIds(Structure asymUnit) {
		List<String> chainIds = new ArrayList<String>();
		for ( Chain c : asymUnit.getChains()){
			String intChainID = c.getId();
			chainIds.add(intChainID);
		}
		return chainIds;
	}
118885
def listing(self):
        ""
        return ['.'.join([f,ext]) if ext else f for (f,ext) in self._files.keys()]
251116
def checkout_dirs(self):
        """"""
        directories = [os.path.join(self.base_directory, d)
                       for d in os.listdir(self.base_directory)]
        return [d for d in directories if os.path.isdir(d)]
920878
def ListDirectoryAbsolute(directory):
  """"""
  return (os.path.join(directory, path)
          for path in tf.io.gfile.listdir(directory))
1102795
def sorted(self, wantdirs=False):
        

        def add_dir(dirs, d):
            dirs.add(d)
            logger.debug('add_dir added %s', d)
            if d != self.base:
                parent, _ = os.path.split(d)
                assert parent not in ('', '/')
                add_dir(dirs, parent)

        result = set(self.files)    # make a copy!
        if wantdirs:
            dirs = set()
            for f in result:
                add_dir(dirs, os.path.dirname(f))
            result |= dirs
        return [os.path.join(*path_tuple) for path_tuple in
                sorted(os.path.split(path) for path in result)]
410399
def list_path(root_dir):
    
    res = []
    if os.path.isdir(root_dir):
        for name in os.listdir(root_dir):
            res.append(name)
    return res
1342668
def _list_queues():
    '''
    
    '''
    queue_dir = __opts__['sqlite_queue_dir']
    files = os.path.join(queue_dir, '*.db')
    paths = glob.glob(files)
    queues = [os.path.splitext(os.path.basename(item))[0] for item in paths]

    return queues
630444
def DirectoriesRelative(self):
        
        # Acquire all directories
        directories = itertools.chain(self.Directories, (os.path.dirname(f) for f in itertools.chain(self.ContentFiles, self.CompileFiles)))
        directories = set(os.path.relpath(d, self.ProjectHome) for d in directories)

        # We need separate entries for parent directories of directories in the list
        for path in set(directories):
            subpath = os.path.dirname(path)
            while subpath:
                directories.add(subpath)
                subpath = os.path.dirname(subpath)

        return sorted(directories)
465998
def sorted_chain(*ranges: Iterable[Tuple[int, int]]) -> List[Tuple[int, int]]:
    """"""
    return sorted(itertools.chain(*ranges))
437647
def serverDirectories(self):
        """"""
        directs = []
        url = self._url + "/directories"
        params = {
            "f" : "json"
        }
        res = self._get(url=url,
                           param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        for direct in res['directories']:
            directs.append(
                ServerDirectory(url=url + "/%s" % direct["name"],
                                securityHandler=self._securityHandler,
                                proxy_url=self._proxy_url,
                                proxy_port=self._proxy_port,
                                initialize=True))
        return directs
1042861
def listdir(self, dirname):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(dirname)
        p = client.get_paginator("list_objects")
        if not path.endswith("/"):
            path += "/"  # This will now only retrieve subdir content
        keys = []
        for r in p.paginate(Bucket=bucket, Prefix=path, Delimiter="/"):
            keys.extend(o["Prefix"][len(path):-1] for o in r.get("CommonPrefixes", []))
            for o in r.get("Contents", []):
                key = o["Key"][len(path):]
                if key:  # Skip the base dir, which would add an empty string
                    keys.append(key)
        return keys