Obtain an array of all directory entries (as hex strings) in the EXIF header.
552829
function getDirEntries(ifdHex) {
        var entries = [],
            offset = 0;

        while (offset + 24 <= ifdHex.length) {
            entries.push(ifdHex.slice(offset, offset + 24));
            offset += 24;
        }

        return entries;
    }
1252642
def list_extmods():
    '''
    
    '''
    ret = {}
    ext_dir = os.path.join(__opts__['cachedir'], 'extmods')
    mod_types = os.listdir(ext_dir)
    for mod_type in mod_types:
        ret[mod_type] = set()
        for _, _, files in salt.utils.path.os_walk(os.path.join(ext_dir, mod_type)):
            for fh_ in files:
                ret[mod_type].add(fh_.split('.')[0])
        ret[mod_type] = list(ret[mod_type])
    return ret
1029949
def get_file_list():
    """"""

    if len(sys.argv) > 1:
        file_list = list(sys.argv[1:])  # make copy
    else:
        files_str = input('Select the files you want to process and drag and drop them onto this window, '
                          'or type their names separated by spaces. Paths containing spaces should be '
                          'surrounded by quotation marks.\nPress ENTER when you\'re done: ')

        if "win" in sys.platform:
            # the POSIX shlex.split uses backslashes for escape sequences, so Windows paths need to set posix=False
            file_list = shlex.split(files_str, posix=False)

            # the non-POSIX shlex.split does not automatically clean quotation marks from the final product
            file_list = [f.replace('"', '').replace("'", "") for f in file_list]
        else:
            file_list = shlex.split(files_str, posix=True)

    # substitute in shell variables and get absolute paths
    for i in range(len(file_list)):
        file_list[i] = os.path.abspath( os.path.expanduser(os.path.expandvars(file_list[i])) )

    return file_list
108592
def check_dir(directory, newly_created_files):
  """"""
  header_parse_failures = []
  for root, dirs, files in os.walk(directory):
    for f in files:
      if f.endswith('.py') and os.path.basename(f) != '__init__.py':
        filename = os.path.join(root, f)
        try:
          check_header(filename, filename in newly_created_files)
        except HeaderCheckFailure as e:
          header_parse_failures.append(e.message)
  return header_parse_failures
1108902
def get_ext_outputs(self):
        """"""

        all_outputs = []
        ext_outputs = []

        paths = {self.bdist_dir: ''}
        for base, dirs, files in sorted_walk(self.bdist_dir):
            for filename in files:
                if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS:
                    all_outputs.append(paths[base] + filename)
            for filename in dirs:
                paths[os.path.join(base, filename)] = (paths[base] +
                                                       filename + '/')

        if self.distribution.has_ext_modules():
            build_cmd = self.get_finalized_command('build_ext')
            for ext in build_cmd.extensions:
                if isinstance(ext, Library):
                    continue
                fullname = build_cmd.get_ext_fullname(ext.name)
                filename = build_cmd.get_ext_filename(fullname)
                if not os.path.basename(filename).startswith('dl-'):
                    if os.path.exists(os.path.join(self.bdist_dir, filename)):
                        ext_outputs.append(filename)

        return all_outputs, ext_outputs
601938
def _parseDataDirectoryExport(self, data, dataDirectoryEntry, exportSection):
        """"""
        if not exportSection:
            return
        functions = []
        export_directory = IMAGE_EXPORT_DIRECTORY.from_buffer(exportSection.raw, to_offset(dataDirectoryEntry.VirtualAddress, exportSection))
        offset = to_offset(export_directory.Name, exportSection)

        checkOffset(offset, exportSection)
        name = get_str(exportSection.raw, offset)

        offsetOfNames = to_offset(export_directory.AddressOfNames, exportSection)
        offsetOfAddress = to_offset(export_directory.AddressOfFunctions, exportSection)
        offsetOfNameOrdinals = to_offset(export_directory.AddressOfNameOrdinals, exportSection)
        for i in range(export_directory.NumberOfNames):
            name_address = c_uint.from_buffer(exportSection.raw, offsetOfNames).value
            name_offset = to_offset(name_address, exportSection)

            checkOffset(name_offset, exportSection)
            func_name = get_str(exportSection.raw, name_offset)
            ordinal = c_ushort.from_buffer(exportSection.raw, offsetOfNameOrdinals).value
            func_addr = c_uint.from_buffer(exportSection.raw, offsetOfAddress).value

            offsetOfNames += 4
            offsetOfAddress += 4
            offsetOfNameOrdinals += 2
            functions.append(FunctionData(name=func_name, rva=func_addr, ordinal=ordinal))

        return ExportDirectoryData(header=export_directory, name=name, functions=functions)
357717
public static File [] getFilesWithPrefix(File dir, final String prefix) {
        FileFilter prefixFilter = new FileFilter() {
                public boolean accept(File pathname)
                {
                    return pathname.getName().toLowerCase().
                        startsWith(prefix.toLowerCase());
                }
            };
        return dir.listFiles(prefixFilter);
    }
434655
public File[] getAllFilesBelow(File dir) {
        Set allFiles = new HashSet();
        if (dir.isDirectory()) {
            primGetAllFilesBelow(dir, allFiles);
        }
        return (File[]) allFiles.toArray(new File[allFiles.size()]);
    }
1271127
function getdirFiles(dir, prefix = '') {
  dir = path.normalize(dir);
  if (!fs.existsSync(dir)) return [];
  const files = fs.readdirSync(dir);
  let result = [];
  files.forEach(item => {
    const currentDir = path.join(dir, item);
    const stat = fs.statSync(currentDir);
    if (stat.isFile()) {
      result.push(path.join(prefix, item));
    } else if (stat.isDirectory()) {
      const cFiles = getdirFiles(currentDir, path.join(prefix, item));
      result = result.concat(cFiles);
    }
  });
  return result;
}
784850
function getEntries(dirName) {
  const entries = {};
  getExamples(dirName, (entryName, filename) => {
    entries[entryName] = filename;
  });
  return entries;
}
1087589
private function mapDir($sDir): ?array
    {
        if (is_dir($sDir)) {

            $aOut = [];

            foreach (new \DirectoryIterator($sDir) as $oFileInfo) {

                if ($oFileInfo->isDot()) {
                    continue;
                }

                //  In the correct format?
                if (preg_match(static::VALID_MIGRATION_PATTERN, $oFileInfo->getFilename(), $aMatches)) {
                    $aOut[$aMatches[1]] = [
                        'path'  => $oFileInfo->getPathname(),
                        'index' => (int) $aMatches[1],
                    ];
                }
            }

            ksort($aOut);
            return $aOut;

        } else {
            return null;
        }
    }
605834
def get_exif_data(self, image):
        """"""
        exif_data = {}
        info = image._getexif()
        if info:
            for tag, value in info.items():
                decoded = TAGS.get(tag, tag)
                if decoded == "GPSInfo":
                    gps_data = {}
                    for t in value:
                        sub_decoded = GPSTAGS.get(t, t)
                        gps_data[sub_decoded] = value[t]

                    exif_data[decoded] = gps_data
                else:
                    exif_data[decoded] = value

        return exif_data
1374778
def Extract(self, components):
    

    for index, component in enumerate(components):
      if component.lower().endswith(self.EXECUTABLE_EXTENSIONS):
        extracted_path = " ".join(components[0:index + 1])
        return [extracted_path]

    return []
1173460
def filtered_entries
      return [] unless exists?

      @filtered_entries ||=
        Dir.chdir(directory) do
          entry_filter.filter(entries).reject do |f|
            path = collection_dir(f)
            File.directory?(path) || entry_filter.symlink?(f)
          end
        end
    end
968324
function (dir) {
    let files = [];
    let list = fs.readdirSync(dir);
    list.forEach(function (file) {
        file = dir + '/' + file;
        let stat = fs.statSync(file);
        if (stat && stat.isDirectory()) files = files.concat(walk(file));
        else files.push(file);
    });
    return files;
}
613204
def _all_filenames(self):
        """"""
        try:
            return [os.path.join(self.cache_dir, filename) for filename in
                    os.listdir(self.cache_dir)]
        except (FileNotFoundError, OSError):
            return []
513903
def file_attribs(location, mode=None, owner=None, group=None, sudo=False):
    """"""
    return dir_attribs(location, mode, owner, group, False, sudo)