List the directories in a specified directory
    Args:
        full_directory_path: The full directory path to check, derive from the os module

    Returns: returns a list of directories
426879
def list_directories_in_directory(full_directory_path):
    
    directories = list()
    for directory_name in __os.listdir(full_directory_path):
        if __os.path.isdir(__os.path.join(full_directory_path, directory_name)):
            directories.append(directory_name)
    return directories
182741
def listdir(self, path, **kwargs):
        """"""
        statuses = self.list_status(path, **kwargs)
        if len(statuses) == 1 and statuses[0].pathSuffix == '' and statuses[0].type == 'FILE':
            raise NotADirectoryError('Not a directory: {!r}'.format(path))
        return [f.pathSuffix for f in statuses]
278942
def ls_dir(path, include_hidden=False):
    
    lst = []
    for file in os.listdir(path):
        hidden_file = FileSystem(file).is_hidden()
        if (hidden_file and include_hidden) or (not hidden_file):
            lst.append(os.path.join(path, file))
    return list(set(lst))
421491
def list_dirs(directory):
    
    return [f for f in pathlib.Path(directory).iterdir() if f.is_dir()]
748426
def list_files(x, path=""):
    
    logger_directory.info("enter list_files")
    file_list = []
    if path:
        # list files from target directory
        files = os.listdir(path)
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # join the path and basename to create full path
                file_list.append(os.path.join(path, file))
    else:
        # list files from current working directory
        files = os.listdir()
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # append basename. not full path
                file_list.append(file)
    logger_directory.info("exit list_files")
    return file_list
823089
def get_paths(directory):
    '''
    '''
    fnames = [os.path.join(directory, f)
              for f in os.listdir(directory)
              if os.path.isfile(os.path.join(directory, f))
              and not f.startswith('.')]
    return fnames
1081301
def collect_dirs(path, max_depth=1, followlinks=True):
    """"""

    if not os.path.isdir(path):
        return []

    o = [path]

    if max_depth == 0:
        return o

    for subdir in os.listdir(path):

        subdir = os.path.join(path, subdir)

        if not os.path.isdir(subdir):
            continue

        o += [subdir]

        if os.path.islink(subdir) and not followlinks:
            continue

        if max_depth > 0:
            o += collect_dirs(subdir, max_depth=max_depth - 1)

    return list(set(o))
1103063
def _get_fullpath(self, filepath):
        
        if filepath[0] == '/':
            return filepath
        return os.path.join(self._base_path, filepath)
1117959
def folders(self):
        """"""
        for directory in self.directory:
            for path in os.listdir(directory):
                full_path = os.path.join(directory, path)
                if os.path.isdir(full_path):
                    if not path.startswith('.'):
                        self.filepaths.append(full_path)
        return self._get_filepaths()
1056517
def listdir(*paths, glob=None):
    '''
    
    '''
    path = genpath(*paths)

    names = os.listdir(path)
    if glob is not None:
        names = fnmatch.filter(names, glob)

    retn = [os.path.join(path, name) for name in names]
    return retn
1177864
def get_subdirs(directory):
    
    return [os.path.join(directory, name)
            for name in os.listdir(directory)
            if os.path.isdir(os.path.join(directory, name))]
1283540
def find_directories(root,fullpath=True):
    '''
    
    '''
    directories = []
    for item in os.listdir(root):
        # Don't include hidden directories
        if not re.match("^[.]",item):
            if os.path.isdir(os.path.join(root, item)):
                if fullpath:
                    directories.append(os.path.abspath(os.path.join(root, item)))
                else:
                    directories.append(item)
    return directories
454376
def list_files(path = Dir.pwd)
      g = MiniGit.new(path)
      g.capturing.ls_files.split
    end
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))]
1242998
def suggest_path(root_dir):
    
    if not root_dir:
        return [os.path.abspath(os.sep), '~', os.curdir, os.pardir]

    if '~' in root_dir:
        root_dir = os.path.expanduser(root_dir)

    if not os.path.exists(root_dir):
        root_dir, _ = os.path.split(root_dir)

    return list_path(root_dir)
1075168
def _walk_directory(root_directory):
        

        paths = [os.path.join(root, name)
                 for root, dirs, files in os.walk(root_directory)  # noqa
                 for name in files]
        paths.sort()
        return paths
1098216
def respond_list_directory(self, dir_path, query=None):
		
		del query
		try:
			dir_contents = os.listdir(dir_path)
		except os.error:
			self.respond_not_found()
			return
		if os.path.normpath(dir_path) != self.__config['serve_files_root']:
			dir_contents.append('..')
		dir_contents.sort(key=lambda a: a.lower())
		displaypath = html.escape(urllib.parse.unquote(self.path), quote=True)

		f = io.BytesIO()
		encoding = sys.getfilesystemencoding()
		f.write(b'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n')
		f.write(b'<html>\n<title>Directory listing for ' + displaypath.encode(encoding) + b'</title>\n')
		f.write(b'<body>\n<h2>Directory listing for ' + displaypath.encode(encoding) + b'</h2>\n')
		f.write(b'<hr>\n<ul>\n')
		for name in dir_contents:
			fullname = os.path.join(dir_path, name)
			displayname = linkname = name
			# Append / for directories or @ for symbolic links
			if os.path.isdir(fullname):
				displayname = name + "/"
				linkname = name + "/"
			if os.path.islink(fullname):
				displayname = name + "@"
				# Note: a link to a directory displays with @ and links with /
			f.write(('<li><a href="' + urllib.parse.quote(linkname) + '">' + html.escape(displayname, quote=True) + '</a>\n').encode(encoding))
		f.write(b'</ul>\n<hr>\n</body>\n</html>\n')
		length = f.tell()
		f.seek(0)

		self.send_response(200)
		self.send_header('Content-Type', 'text/html; charset=' + encoding)
		self.send_header('Content-Length', length)
		self.end_headers()
		shutil.copyfileobj(f, self.wfile)
		f.close()
		return