Get all icons in this DAP, optionally strip extensions
778648
def icons(self, strip_ext=False):
        ''''''
        result =  [f for f in self._stripped_files if self._icons_pattern.match(f)]
        if strip_ext:
            result = [strip_suffix(f, '\.({ext})'.format(ext=self._icons_ext), regex=True) for f in result]

        return result
397992
def pull_all_external(collector, **kwargs):
    """"""
    deps = set()

    images = collector.configuration["images"]
    for layer in Builder().layered(images):
        for image_name, image in layer:
            for dep in image.commands.external_dependencies:
                deps.add(dep)

    for dep in sorted(deps):
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)
537963
protected function parseListOfIcons()
    {
        $cache = $this->cacheManager->getCache('Default');
        $cacheId = 'FontIconDataSource_parseListOfIcons';

        if (!($icons = $cache->get($cacheId))) {
            $icons = [];
            foreach (file(self::$iconsListFilePath) as $content) {
                if (preg_match('#fa-var-([-_a-z0-9]+):#i', $content, $match)) {
                    $icons[] = $match[1];
                }
            }

            $cache->set($cacheId, $icons, [], 0);
        }

        return $icons;
    }
375761
def load_icons(appname, package=""):
    
    # loop over system path
    global __icons_loaded
    if __icons_loaded:
        return
    icon_paths = ['/usr/local/share/meqtrees'] + sys.path
    for path in icon_paths:
        path = path or '.'
        # for each entry, try <entry>/icons/<appname>'
        trydir = os.path.join(path, package, 'icons', appname)
        _dprint(3, 'trying icon path', trydir)
        try:
            files = os.listdir(trydir)
        except:
            continue
        _dprint(3, len(files), 'entries in', trydir)
        # loop over all files
        nicons = 0
        for f in files:
            (name, ext) = os.path.splitext(f);  # check extension
            if ext in ('.png', '.xpm', '.gif'):
                f = os.path.join(trydir, f)
                try:
                    pm = QPixmap(f)
                except:
                    _dprint(3, 'error loading icon', name, sys.exc_value())
                    continue
                # register pixmap as global symbol using the supplied name
                if name in globals():
                    globals()[name].assign(pm)
                else:
                    globals()[name] = QPixmapWrapper(pm)
                nicons += 1
                _dprint(4, 'loaded icon', f)
            else:
                _dprint(4, 'ignoring entry', f)
        _dprint(1, nicons, 'icons loaded from ', trydir)
        __icons_loaded = True
1186499
def _load(self):
        """'"""
        # loop over system path
        if self._loaded:
            return
        icon_paths = ['/usr/local/share/meqtrees'] + sys.path
        for path in icon_paths:
            path = path or '.'
            # for each entry, try <entry>/icons/<appname>'
            for a, b in [('icons', self._appname), (self._appname, 'icons')]:
                trydir = os.path.join(path, a, b)
                _dprint(3, 'trying icon path', trydir)
                try:
                    files = os.listdir(trydir)
                except:
                    continue
                _dprint(3, len(files), 'entries in', trydir)
                # loop over all files
                nicons = 0
                for f in files:
                    (name, ext) = os.path.splitext(f);  # check extension
                    if ext in ('.png', '.xpm', '.gif'):
                        f = os.path.join(trydir, f)
                        try:
                            pm = QPixmap(f)
                        except:
                            _dprint(3, 'error loading icon', name, sys.exc_value())
                            continue
                        # register pixmap
                        self._pixmaps[name] = QPixmapWrapper(pm)
                        nicons += 1
                        _dprint(4, 'loaded icon', f)
                    else:
                        _dprint(4, 'ignoring entry', f)
                _dprint(1, nicons, 'icons loaded from ', trydir)
                self._loaded = True
988989
def getAllAsDict(self):
        """"""
        return {p: self._plugins[p].get_raw() for p in self._plugins}
471178
async function collecticonsBundle (params) {
  const {
    dirPath,
    destFile
  } = params;

  await validateDirPath(dirPath);

  const resultFiles = await collecticonsCompile({
    dirPath,
    styleFormats: ['css'],
    styleDest: './styles',
    fontDest: './',
    fontTypes: ['woff', 'woff2'],
    previewDest: './',
    noFileOutput: true
  });

  if (resultFiles === null) return;

  // Create zip.
  let zip = new JSZip();

  // Add generated files.
  resultFiles.forEach(file => {
    zip.file(file.path, file.contents);
  });

  // Add the icons.
  const dir = await fs.readdir(dirPath);
  const svgs = await Promise.all(dir.map(async file => {
    return file.endsWith('.svg')
      ? (
        {
          path: `icons/${file}`,
          contents: await fs.readFile(path.resolve(dirPath, file))
        }
      )
      : null;
  }));

  svgs.forEach(file => {
    zip.file(file.path, file.contents);
  });

  await fs.ensureDir(path.dirname(destFile));
  await fs.writeFile(destFile, zip.generate({ base64: false, compression: 'DEFLATE' }), 'binary');
}
431039
def get_missing_deps(self, obj):
        '''
        
        '''
        deps = self.get_deps(obj)
        ret = []
        for key in deps:
            provider = self._providers.get(key)
            if provider and provider.providable:
                continue
            ret.append(key)
        return ret
441741
def get_paths(self, theme, icon_size):
        """"""

        _size_str = "x".join(map(str, icon_size))

        theme_path = get_program_path() + "share" + os.sep + "icons" + os.sep
        icon_path = theme_path + theme + os.sep + _size_str + os.sep
        action_path = icon_path + "actions" + os.sep
        toggle_path = icon_path + "toggles" + os.sep

        return theme_path, icon_path, action_path, toggle_path
1179158
def _get_pygments_extensions():
    """"""
    # NOTE: Leave this import here to keep startup process fast!
    import pygments.lexers as lexers

    extensions = []
    for lx in lexers.get_all_lexers():
        lexer_exts = lx[2]

        if lexer_exts:
            # Reference: This line was included for leaving untrimmed the
            # extensions not starting with `*`
            other_exts = [le for le in lexer_exts if not le.startswith('*')]
            # Reference: This commented line was replaced by the following one
            # to trim only extensions that start with '*'
            # lexer_exts = [le[1:] for le in lexer_exts]
            lexer_exts = [le[1:] for le in lexer_exts if le.startswith('*')]
            lexer_exts = [le for le in lexer_exts if not le.endswith('_*')]
            extensions = extensions + list(lexer_exts) + list(other_exts)

    return sorted(list(set(extensions)))
1095724
def tab_complete(string):
    
    if is_option(string):
        return string
    if not missing_extension(string):
        return string
    if os.path.isfile(string):
        return string
    extended_files = [f for f in extend(string) if os.path.isfile(f)]
    try:
        return extended_files[0]
    except IndexError:
        return string
1030001
function getLockfileDependencies(root) {
  var deps = {};
  if (root.name && root.version) {
    deps[root.name + "@" + root.version] = {
      "pm": "npm",
      "name": root.name,
      "version": root.version
    };
  }

  if (root.dependencies) {
    for (var name in root.dependencies) {
      var dep = root.dependencies[name];
      if (dep.version) {
        deps[name + "@" + dep.version] = {
          "pm": "npm",
          "name": name,
          "version": dep.version
        };
      }

      var childDeps = getLockfileDependencies(root.dependencies[name]);
      for (var attr in childDeps) {
        deps[attr] = childDeps[attr];
      }
    }
  }

  return Object.keys(deps).map(function (k) { return deps[k];});
}
194403
def get_c_sources(folder, include_headers=False):
    """"""
    allowed_extensions = [".c", ".C", ".cc", ".cpp", ".cxx", ".c++"]
    if include_headers:
        allowed_extensions += [".h", ".hpp"]
    sources = []
    for root, _, files in os.walk(folder):
        for name in files:
            ext = os.path.splitext(name)[1]
            if name == "types.cc":
                # Make sure `types.cc` is compiled first, as it has multiple
                # useful static assertions.
                sources.insert(0, os.path.join(root, name))
            elif ext in allowed_extensions:
                sources.append(os.path.join(root, name))
    return sources
30307
def _get_md_files(self):
        """"""
        all_f = _all_files_matching_ext(os.getcwd(), "md")
        exclusions = [
            "*.egg/*",
            "*.eggs/*",
            "*build/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
266219
def list_extensions():
    '''
    

    '''
    import nnabla_ext.cpu
    from os.path import dirname, join, realpath
    from os import listdir
    ext_dir = realpath((join(dirname(nnabla_ext.cpu.__file__), '..')))
    return listdir(ext_dir)
721864
def get_installed_daps_detailed():
    ''''''
    daps = {}
    for loc in _data_dirs():
        s = get_installed_daps(loc)
        for dap in s:
            if dap not in daps:
                daps[dap] = []
            daps[dap].append({'version': get_installed_version_of(dap, loc), 'location': loc})
    return daps
1332620
def _get_available_extensions():
    
    extensions = []

    # from filenames
    parsers_dir = os.path.join(os.path.dirname(__file__))
    glob_filename = os.path.join(parsers_dir, "*" + _FILENAME_SUFFIX + ".py")
    ext_re = re.compile(glob_filename.replace('*', "(?P<ext>\w+)"))
    for filename in glob.glob(glob_filename):
        ext_match = ext_re.match(filename)
        ext = ext_match.groups()[0]
        extensions.append(ext)
        extensions.append('.' + ext)

    # from relevant synonyms (don't use the '' synonym)
    for ext in EXTENSION_SYNONYMS.keys():
        if ext:
            extensions.append(ext)
            extensions.append(ext.replace('.', '', 1))
    extensions.sort()
    return extensions