Requires any modules that match the given glob patterns
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;
        }
1126185
def glob(cls, files=None):
        '''
        
        '''
        files = files or []
        if isinstance(files, str):
            files = os.path.normpath(files)
            matches = lambda path: matches_patterns(path, [files])
            return [path for path in cls.get_static_files() if matches(path)]
        elif isinstance(files, (list, tuple)):
            all_files = cls.get_static_files()
            files = [os.path.normpath(f) for f in files]
            sorted_result = []
            for pattern in files:
                sorted_result.extend([f for f in all_files if matches_patterns(f, [pattern])])
            return sorted_result
568674
def match_modules(allowed_modules):
    """"""
    cleaned_allowed_modules = [
        utils.mod_to_mod_name(tmp_mod)
        for tmp_mod in allowed_modules
    ]
    cleaned_split_allowed_modules = [
        tmp_mod.split(".")
        for tmp_mod in cleaned_allowed_modules
    ]
    cleaned_allowed_modules = []
    del cleaned_allowed_modules

    def matcher(cause):
        cause_cls = None
        cause_type_name = cause.exception_type_names[0]
        # Rip off the class name (usually at the end).
        cause_type_name_pieces = cause_type_name.split(".")
        cause_type_name_mod_pieces = cause_type_name_pieces[0:-1]
        # Do any modules provided match the provided causes module?
        mod_match = any(
            utils.array_prefix_matches(mod_pieces,
                                       cause_type_name_mod_pieces)
            for mod_pieces in cleaned_split_allowed_modules)
        if mod_match:
            cause_cls = importutils.import_class(cause_type_name)
            cause_cls = ensure_base_exception(cause_type_name, cause_cls)
        return cause_cls

    return matcher
318704
function(name) {
			var match = null;
			list.forEach(function(file) {
				if(_.indexOf(file.modules, name) >= 0) {
					match = file;
					return false;
				}
			});
			return match;
		}
560393
function globalyzer(pattern, opts = {}) {
  let base = parent(pattern, opts);
  let isGlob = isglob(pattern, opts);
  let glob;

  if (base != '.') {
    glob = pattern.substr(base.length);
    if (glob.startsWith('/')) glob = glob.substr(1);
  } else {
    glob = pattern;
  }

  if (!isGlob) {
    base = path.dirname(pattern);
    glob = base !== '.' ? pattern.substr(base.length) : pattern;
  }

  if (glob.startsWith('./')) glob = glob.substr(2);
  if (glob.startsWith('/')) glob = glob.substr(1);

  return { base, glob, isGlob };
}
722373
def match_filenames(filenames, pattern):
    """"""
    matching = []

    for filename in filenames:
        if fnmatch(get_filebase(filename, pattern), globify(pattern)):
            matching.append(filename)

    return matching
259880
function Pattern(glob, options, isNegated) {
  utils.defineProp(this, 'cache', new Map());
  this.negated = !!isNegated;
  this.options = options || {};
  this.parse(glob);
  return this;
}
47018
def super_glob(pattern):
    ''
    pieces = pattern.split('/')
    if '**' in pieces:
        prefix = '/'.join(pieces[:pieces.index('**')])
        postfix = '/'.join(pieces[pieces.index('**') + 1:])
        roots = [dirname
                 for dirname, dirnames, filenames in os.walk(prefix)]
        patterns = [root + '/' + postfix for root in roots]
    else:
        patterns = ['/'.join(pieces)]
    return chain.from_iterable(glob(pattern) for pattern in patterns)
866683
function globSearch(searchRegex) {
  const search = path.join(__dirname, '..', `${searchRegex}`)
  return glob(`${search}`, {ignore: ['**/node_modules/**']})
  .then(files => {
    return new Promise((resolve, reject) => {
      resolve(archiveComps(files))
    })
  })
  .catch(globErr)
}
544426
def globs_in_single_dir(cls, spec_dir_path, address_mapper):
    """"""
    return [os.path.join(spec_dir_path, pat) for pat in address_mapper.build_patterns]
193986
function cog(glob) {
  if (typeof glob === 'undefined') {
    var glob = '**/*';
  }

  // Collect all files, before we filter stream
  var allFiles = {};
  var collectFilesStream = through.obj(function(file, enc, cb) {
    allFiles[file.relative] = file;
    cb();
  }, function(cb) {
    _.each(allFiles, function(file) {
      collectFilesStream.push(file);
    });
    cb();
  });

  // Get all includes for a file
  function getIncludes(file) {
    var content = String(file.contents);
    var matches = [];

    while (regexMatch = DIRECTIVE_REGEX.exec(content)) {
      matches.push(regexMatch);
    }

    // For every require fetch it's matching files
    var fileLists = _.map(matches, function(match) {
      return globMatch(match, file).sort();
    });

    // Merge all matching file lists into one concat list
    var order = _.reduce(fileLists, function(memo, fileList) {
      return _.union(memo, fileList);
    }, []);

    // And self to include list
    order.push(file.relative);
    return order;
  }

  function getRelativeDir(file) {
    var relativeDir = _.initial(file.relative.split('/')).join('/');
    if (relativeDir.length > 0) {
      relativeDir += '/';
    }
    return relativeDir;
  }

  // Translate an include match to a glob
  function globMatch(match, file) {
    var directiveType = match[1];
    var globPattern = match[2]; // relative file

    // require all files under a directory
    if (directiveType.indexOf('_tree') !== -1) {
      globPattern = globPattern.concat('/**/*');
      directiveType = directiveType.replace('_tree', '');
    }

    // require only first level files in a directory
    if (directiveType.indexOf('_directory') !== -1) {
      globPattern = globPattern.concat('/*');
      directiveType = directiveType.replace('_directory', '');
    }

    // Only require and include directives are allowed
    if (directiveType !== 'require' && directiveType !== 'include') {
      return [];
    }

    // Add file extension to glob pattern if not already set
    var jsExt = '.js';
    if (globPattern.substr(globPattern.length-jsExt.length).indexOf(jsExt) !== 0) {
      globPattern += jsExt;
    } 

    // Append the current dir to include so we can match the glob against the file list
    var relativeDir = getRelativeDir(file);
    globPattern = relativeDir+globPattern;

    var possibleIncludes = [];
    _.each(_.keys(allFiles), function(fileName) {
      // Only process files in the current directory. ../ will not work.
      if (fileName.indexOf(relativeDir) !== 0) {
        return;
      }

      possibleIncludes.push(fileName);
    });
    
    return minimatch.match(possibleIncludes, globPattern);
  }


  // creating a stream through which each file will pass
  var concatFiles = [];
  var buildIncludesStream = through.obj(function(file, enc, cb) {
    if (file.isStream()) {
      this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!'));
      return cb();
    }

    // Attach includes to masterfile
    file.includes = _.filter(_.map(getIncludes(file), function(filename) {
      return allFiles[filename];
    }, function(file) {
      return !!file;
    }));

    this.push(file);
    cb();
  });

  /*
   * Construct the stream.
   * 
   * Steps:
   * 1. Build a list of all files in the stream for use later
   * 2. Filter files to only desired master concat files
   * 3. Build concat manifests data objects for each of the master files
   */
  var stream = sc(
    collectFilesStream,
    filter(glob),
    buildIncludesStream
  );

  return stream;
}
582809
def my_glob(pattern):
    
    result = []
    if pattern[0:4] == 'vos:':
        dirname = os.path.dirname(pattern)
        flist = listdir(dirname)
        for fname in flist:
            fname = '/'.join([dirname, fname])
            if fnmatch.fnmatch(fname, pattern):
                result.append(fname)
    else:
        result = glob(pattern)
    return result
247083
function getFeatureFiles(args, ignoreArg) {
  var files = [];
  var patterns = args.length ? args : ['.'];

  patterns.forEach(function(pattern) {
    // First we need to fix up the pattern so that it only matches .feature files
    // and it's in the format that glob expects it to be
    var fixedPattern;
    if (pattern == '.') {
      fixedPattern = '**/*.feature';
    } else if (pattern.match(/.*\/\*\*/)) {
      fixedPattern = pattern + '/**.feature';
    } else if (pattern.match(/.*\.feature/)) {
      fixedPattern = pattern;
    } else {
      try {
        if (fs.statSync(pattern).isDirectory()) {
          fixedPattern = path.join(pattern, '**/*.feature');
        }
      } catch(e) {
        // Don't show the fs callstack, we will print a custom error message bellow instead
      }
    }

    if (!fixedPattern) {
      logger.boldError(`Invalid format of the feature file path/pattern: "${pattern}".\nTo run the linter please specify an existing feature file, directory or glob.`);
      process.exit(1);
      return; // This line will only be hit by tests that stub process.exit
    }

    var globOptions = {ignore: getIgnorePatterns(ignoreArg)};
    files = files.concat(glob.sync(fixedPattern, globOptions));
  });
  return _.uniq(files);
}
1342776
def globChildren(self, pattern):
        
        import glob
        path = self.path[-1] == '/' and self.path + pattern or slash.join([self.path, pattern])
        return map(self.clonePath, glob.glob(path))
502420
def file_matches(filename, patterns):
    """"""
    return any(fnmatch.fnmatch(filename, pat)
               or fnmatch.fnmatch(os.path.basename(filename), pat)
               for pat in patterns)
1104467
def globfilter(filenames, patterns, *, flags=0):
    """"""

    matches = []

    flags = _flag_transform(flags)
    unix = _wcparse.is_unix_style(flags)
    obj = _wcparse.compile(_wcparse.split(patterns, flags), flags)

    for filename in filenames:
        if not unix:
            filename = util.norm_slash(filename)
        if obj.match(filename):
            matches.append(filename)
    return matches
1308699
function (options, patterns) {
				// Return all matching filepaths.
				var matches = processPatterns(patterns, function (pattern) {
					// Find all matching files for this pattern.
					return glob.sync(pattern, options);
				});

				// Filter result set?
				if (options.filter) {
					matches = matches.filter(function (filepath) {
						filepath = path.join(options.cwd || '', filepath);

						try {
							if (typeof options.filter === 'function') {
								return options.filter(filepath);
							} else {
								// If the file is of the right type and exists, this should work.
								return fs.statSync(filepath)[options.filter]();
							}
						} catch (e) {
							// Otherwise, it's probably not the right type.
							return false;
						}
					});
				}

				return matches;
			}