Expands a user-provided specification of source files into a list of paths.
971220
def _expand_sources(sources):
    '''
    
    '''
    if sources is None:
        return []
    if isinstance(sources, six.string_types):
        sources = [x.strip() for x in sources.split(',')]
    elif isinstance(sources, (float, six.integer_types)):
        sources = [six.text_type(sources)]
    return [path
            for source in sources
            for path in _glob(source)]
889268
function expandIncludes(source, rootPath) {
	var matcher = new RegExp("^([\t ]*)include ([^/].*);\n?", "gm");
	var match;
	var expanded = '';
	var after = source;
	var includes = [];
	var lastIndex = 0;
	while (match = matcher.exec(source)) {
		var statement = match[0];
		var indent = match[1];
		var filePath = path.join(rootPath, match[2])
		includes.push(filePath);

		expanded += source.substr(lastIndex, match.index - lastIndex);

		expanded += indent + "## Start Include: " + filePath + "\n";

		try {
			var fileContent = fs.readFileSync(filePath, 'utf8');

			// preserve indentation of the include line
			var indentedContent = singleTrailingNewline(NgindoxUtil.indentBlock(fileContent, indent));

			// recurse with relative path
			expanded += expandIncludes(indentedContent, path.dirname(rootPath));
		} catch (err) {
			// file probably missing
			expanded += indent + "## Error: " + err + "\n";
		}

		expanded += indent + "## End Include: " + filePath + "\n";

		// store end of match as begining of next search
		lastIndex = matcher.lastIndex;
	}

	expanded += source.substr(lastIndex);

	return expanded;
}
1114285
def _normalize_file_paths(self, *args):
        """"""
        paths = []
        for arg in args:
            if arg is None:
                continue
            elif self._is_valid_file(arg):
                paths.append(arg)
            elif isinstance(arg, list) and all(self._is_valid_file(_) for _ in arg):
                paths = paths + arg
            elif not self.ignore_errors:
                raise TypeError('Config file paths must be string path or list of paths!')
        return paths
1211097
def expand_filename_pattern(pattern, base_dir):
    
    # 'join' ignores base_dir, if expandedPattern is absolute.
    # 'normpath' replaces 'A/foo/../B' with 'A/B', for pretty printing only
    pattern = os.path.normpath(os.path.join(base_dir, pattern))

    # expand tilde and variables
    pattern = os.path.expandvars(os.path.expanduser(pattern))

    # expand wildcards
    fileList = glob.glob(pattern)

    return fileList
422883
def expand_file_names(path, files_root):
    
    # For non-wildcards just return the path. This allows us to detect when
    # explicitly listed files are missing.
    if not any(wildcard in path for wildcard in '*?['):
        return [path]
    else:
        dir_path, filename = os.path.split(path)
        return [os.path.join(dir_path, f) for f in fnmatch.filter(os.listdir(os.path.join(files_root, dir_path)), filename)]
317461
def from_sources_field(sources, spec_path):
    
    if sources is None:
      return Files(spec_path=spec_path)
    elif isinstance(sources, BaseGlobs):
      return sources
    elif isinstance(sources, string_types):
      return Files(sources, spec_path=spec_path)
    elif isinstance(sources, (MutableSet, MutableSequence, tuple)) and \
         all(isinstance(s, string_types) for s in sources):
      return Files(*sources, spec_path=spec_path)
    else:
      raise ValueError('Expected either a glob or list of literal sources: got: {}'.format(sources))
744048
def __extend_targets_sources(target, source):
    
    if not SCons.Util.is_List(target):
        target = [target]
    if not source:
        source = target[:]
    elif not SCons.Util.is_List(source):
        source = [source]
    if len(target) < len(source):
        target.extend(source[len(target):])
        
    return target, source
266533
def make_multiple(self, specifications, options=None):
        
        filenames = []
        for specification in specifications:
            filenames.extend(self.make(specification, options))
        return filenames
1077193
def expand_dirs_to_files(*dirs)
      extensions = %w[rb erb rake rhtml haml slim builder rxml rabl]

      dirs.flatten.map do |entry|
        next unless File.exist? entry

        if File.directory? entry
          Dir[File.join(entry, '**', "*.{#{extensions.join(',')}}")]
        else
          entry
        end
      end.flatten
    end
251381
def _GetExpandedPaths(args):
  """"""
  opts = globbing.PathOpts(
      follow_links=args.follow_links, pathtype=args.pathtype)

  for path in args.paths:
    for expanded_path in globbing.ExpandPath(str(path), opts):
      yield expanded_path
776627
def source_files(mongodb_path):
    """"""
    for root, dirs, files in os.walk(mongodb_path):
        for filename in files:
            # skip files in dbtests folder
            if 'dbtests' in root:
                continue
            if filename.endswith(('.cpp', '.c', '.h')):
                yield os.path.join(root, filename)
548654
def source_files(self):
        """"""
        if 'srcs' in self.params and self.params['srcs'] is not None:
            return util.flatten(self.params['srcs'])
341923
public void expandClasspath(String... paths) {
        if (paths == null || paths.length == 0) {
            return;
        }
        for (String path: paths) {
            expandClasspath(new File(PathUtil.resolve(path)));
        }
    }
375331
def path_expand(cls, path):
        
        current_dir = "." + os.path.sep
        if path.startswith(current_dir):
            cwd = str(os.getcwd())
            path = path.replace(current_dir, cwd, 1)
        location = os.path.expandvars(os.path.expanduser(path))
        return location
787304
def gen_files(path, prefix="_"):
    "  "

    if op.isdir(path):
        for name in listdir(path):
            fpath = op.join(path, name)
            if is_parsed_file(fpath):
                yield op.abspath(fpath)

    elif is_parsed_file(path):
        yield op.abspath(path)
1033742
def package_files(directory):
    """"""
    paths = []
    for (path, _, file_names) in walk(directory):
        for filename in file_names:
            paths.append(join('..', path, filename))
    return paths
411534
private Set<String> initExcludedPathList(Set<String> paths) {
		Set<String> toExclude = new HashSet<>();
		if (null == paths)
			return toExclude;

		for (String path : paths) {
			path = PathNormalizer.asPath(path);
			toExclude.add(path);
		}
		return toExclude;
	}