Grab globs of things
500017
def _parse_glob_spec(self, spec):
        '''
        
        '''
        some_globs = glob.glob(spec['glob'])
        if not some_globs:
            return []
        el_globs = []
        for g in some_globs:
            _spec = copy.copy(spec)
            _spec['file'] = g
            el_globs.append(_spec)
        return el_globs
833720
def _objectify(items, container_name):
    """"""
    objects = []

    # Deal with objects and object pseudo-folders first, save subdirs for later
    for item in items:
        if item.get("subdir", None) is not None:
            object_cls = PseudoFolder
        else:
            object_cls = StorageObject

        objects.append(object_cls(item, container_name))

    return objects
758838
def globlookup(pattern, root):
    
    for subdir, dirnames, filenames in os.walk(root):
        d = subdir[len(root) + 1:]
        files = (os.path.join(d, f) for f in filenames)
        for f in fnmatch.filter(files, pattern):
            yield f
342010
function loadUses() {
          var globs = Array.prototype.slice.call(arguments, 0);
          var path = require('path');
          utils.forEach(globs, function(patt) {
            var files = glob.sync(patt, {});
            utils.forEach(files, function(file) {
              require(path.join(process.cwd(), file));
            });
          });

          return moduleInstance;
        }
1017950
def glob_in_parents(dir, patterns, upper_limit=None):
    """"""

    assert(isinstance(dir, str))
    assert(isinstance(patterns, list))

    result = []

    absolute_dir = os.path.join(os.getcwd(), dir)
    absolute_dir = os.path.normpath(absolute_dir)
    while absolute_dir:
        new_dir = os.path.split(absolute_dir)[0]
        if new_dir == absolute_dir:
            break
        result = glob([new_dir], patterns)
        if result:
            break
        absolute_dir = new_dir

    return result
313920
function getSourceFilesFromGlob(globPattern, ignoreGlobs) {
    return new Promise((fulfil, reject) => {
        glob(globPattern, { ignore: ignoreGlobs }, (err, files) => {
            if (err) {
                reject(err);
            } else {
                fulfil(files);
            }
        });
    });
}
546148
def items(self):
        """"""
        contents = self.paths
        contents = (
            BinFile(path.path) if path.is_file else BinDir(path.path)
            for path in contents
        )
        return contents
1107597
public function collectGarbage()
    {
        if ($this->freeze) {
            throw new \Exception('Backend is frozen!', 123789);
        }

        $lifetimeFiles = \glob(GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER) . '*/*/*' . self::FILE_EXTENSION_LIFETIME);

        $identifiers = [];

        foreach ($lifetimeFiles as $lifetimeFile) {
            if ((int)\file_get_contents($lifetimeFile) < \time()) {
                $identifiers[] = \file_get_contents(\str_replace(self::FILE_EXTENSION_LIFETIME, self::FILE_EXTENSION_IDENTIFIER, $lifetimeFile));
            }
        }

        foreach ($identifiers as $identifier) {
            $this->remove($identifier);
        }
    }
109700
def pick_things(pools, key, n):
    ""
    pool = pools.get(key)
    if not pool:
        return []
    things = pool[:n]
    del pool[:n]
    return things
1178195
def getobjects(bunchdt, data, commdct, key, places=7, **kwargs):
    """"""
    idfobjects = bunchdt[key]
    allobjs = []
    for obj in idfobjects:
        if __objecthasfields(
                bunchdt, data, commdct,
                obj, places=places, **kwargs):
            allobjs.append(obj)
    return allobjs
78385
function(glob) {
    var newObjects = [];
    var regex = this._globToRegex(glob);
    for (var i = 0; i < this._objects.length; ++i) {
      var obj = this._objects[i];
      if (!regex.test(obj.name())) {
        newObjects.push(obj);
      } else {
        obj.destroy();
      }
    }
    this._objects = newObjects;
  }
886170
def find_all_files(glob):
    
    for finder in finders.get_finders():
        for path, storage in finder.list([]):
            if fnmatch.fnmatchcase(os.path.join(getattr(storage, 'prefix', '')
                                                or '', path),
                                   glob):
                yield path, storage
827154
function gatherSnapWrap() {
    var element;
    var value;
    for (element = $element; element.length; element = element.parent()) {
      value = element.attr('md-autocomplete-snap');
      if (angular.isDefined(value)) break;
    }

    if (element.length) {
      return {
        snap: element[0],
        wrap: (value.toLowerCase() === 'width') ? element[0] : $element.find('md-autocomplete-wrap')[0]
      };
    }

    var wrap = $element.find('md-autocomplete-wrap')[0];
    return {
      snap: wrap,
      wrap: wrap
    };
  }
408150
def glob(self, filename):
        """"""
        if isinstance(filename, six.string_types):
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for matching_filename in py_glob.glob(
                    compat.as_bytes(filename))
            ]
        else:
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for single_filename in filename
                for matching_filename in py_glob.glob(
                    compat.as_bytes(single_filename))
            ]
637929
def get_all(self):
        """"""
        logger.debug('Fetching items. Path: {data_file}'.format(
            data_file=self.data_file
        ))

        return load_file(self.data_file)
537948
def pickle_dump(self):
        """"""
        with open(os.path.join(self.workdir, self.PICKLE_FNAME), mode="wb") as fh:
            pickle.dump(self, fh)
731150
def get(tgt, fun, tgt_type='glob'):
    '''
    
    '''
    ret = salt.utils.minions.mine_get(tgt, fun, tgt_type, __opts__)
    return ret