Return list of volumes or diffs in this Store's selected directory.
481392
def listContents(self):
        
        vols = list(self.listVolumes())
        vols.sort(key=lambda v: self.getSendPath(v))
        return [vol.display(self, detail="line") for vol in vols]
1009570
function getFolders(dir) {
  try {
    return fs.readdirSync(dir)
      .filter(function (file) {
        return exports.isDirectory(path.join(dir, file));
      });
  } catch (ex) {
    return [];
  }
}
576879
def _get_dir_list(load):
    '''
    
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    if 'saltenv' not in load or load['saltenv'] not in envs():
        return []
    ret = set()
    for repo in init():
        repo['repo'].open()
        ref = _get_ref(repo, load['saltenv'])
        if ref:
            manifest = repo['repo'].manifest(rev=ref[1])
            for tup in manifest:
                filepath = tup[4]
                split = filepath.rsplit('/', 1)
                while len(split) > 1:
                    relpath = os.path.relpath(split[0], repo['root'])
                    # Don't add '.'
                    if relpath != '.':
                        # Don't add files outside the hgfs_root
                        if not relpath.startswith('../'):
                            ret.add(os.path.join(repo['mountpoint'], relpath))
                    split = split[0].rsplit('/', 1)
        repo['repo'].close()
    if repo['mountpoint']:
        ret.add(repo['mountpoint'])
    return sorted(ret)
870486
def get_filenames_diff(self, r):
        """"""
        cmd = self.filenames_diff_cmd(r)

        diff_files = shell_out_ignore_exitcode(cmd, cwd=self.root)
        diff_files = self.parse_diff_filenames(diff_files)

        return set(f for f in diff_files if f.endswith('.py'))
12479
def getdirs(self, section, option, raw=False, vars=None, fallback=[]):
        
        globs = self.getlist(section, option, fallback=[])
        return [f for g in globs for f in glob.glob(g) if os.path.isdir(f)]
422571
def _list_dir(self):
        
        return [os.path.join(self._path, fn) for fn in os.listdir(self._path)
                if not fn.endswith(self._fs_transaction_suffix)]
603151
function readDirAbs(dir, cb) {
  fs.readdir(dir, function(err, entries) {
    if (err || !entries) {
      return cb(err, null);
    }
    var items = [];
    entries.forEach(function(entry) {
      items.push(path.join(dir, entry));
    });
    return cb(null, items);
  });
}
160629
def makecsvdiffs(thediffs, dtls, n1, n2):
    """"""
    def ishere(val):
        if val == None:
            return "not here"
        else:
            return "is here"
    rows = []
    rows.append(['file1 = %s' % (n1, )])
    rows.append(['file2 = %s' % (n2, )])
    rows.append('')
    rows.append(theheader(n1, n2))
    keys = list(thediffs.keys()) # ensures sorting by Name
    keys.sort()
    # sort the keys in the same order as in the idd
    dtlssorter = DtlsSorter(dtls)
    keys = sorted(keys, key=dtlssorter.getkey)
    for key in keys:
        if len(key) == 2:
            rw2 = [''] + [ishere(i) for i in thediffs[key]]
        else:
            rw2 = list(thediffs[key])
        rw1 = list(key)
        rows.append(rw1 + rw2)
    return rows
134365
def diff_files(left, right, diff_options=None, formatter=None):
    """"""
    return _diff(etree.parse, left, right,
                 diff_options=diff_options, formatter=formatter)
552155
def filter(self, table, volumes, filter_string):
        """"""
        q = filter_string.lower()
        return [volume for volume in volumes
                if q in volume.name.lower()]
1075327
def _get_all_indexes(self):
        """"""
        if self.parser:
            return [v.index for v in self.parser.get_volumes()] + [d.index for d in self.parser.disks]
        else:
            return None
277778
def listdir(self, dirname):
        """"""
        if not self.isdir(dirname):
            raise errors.NotFoundError(None, None, "Could not find directory")

        entries = os.listdir(compat.as_str_any(dirname))
        entries = [compat.as_str_any(item) for item in entries]
        return entries
256993
def get_cookbook_dirs(self, base_dir=None):
        """"""
        if base_dir is None:
            base_dir = self.env_root

        cookbook_dirs = []
        dirs_to_skip = set(['.git'])
        for root, dirs, files in os.walk(base_dir):  # pylint: disable=W0612
            dirs[:] = [d for d in dirs if d not in dirs_to_skip]
            for name in files:
                if name == 'metadata.rb':
                    if 'cookbook' in os.path.basename(os.path.dirname(root)):
                        cookbook_dirs.append(root)
        return cookbook_dirs
1362173
def getSubdirectories(d):
	'''
	'''
	return [f for f in os.listdir(d) if os.path.isdir(os.path.join(d, f)) ]
806834
def finddirs(root):
    """"""
    retval = []
    for root, dirs, files in os.walk(root):
        for d in dirs:
            retval.append(os.path.join(root, d))
    return retval
387422
def compute_diff(dir_base, dir_cmp):
    
    data = {}
    data['deleted'] = list(set(dir_cmp['files']) - set(dir_base['files']))
    data['created'] = list(set(dir_base['files']) - set(dir_cmp['files']))
    data['updated'] = []
    data['deleted_dirs'] = list(set(dir_cmp['subdirs']) - set(dir_base['subdirs']))

    for f in set(dir_cmp['files']).intersection(set(dir_base['files'])):
        if dir_base['index'][f] != dir_cmp['index'][f]:
            data['updated'].append(f)

    return data
196645
def get_hour_dirs(root=None):
    """"""
    root = root or selfplay_dir()
    return list(filter(lambda s: re.match(r"\d{4}-\d{2}-\d{2}-\d{2}", s),
                       gfile.ListDirectory(root)))