Compiles a series of Files from file names.
178728
public void compile(String[] files) throws CompilationFailedException {
        CompilationUnit unit = new CompilationUnit(configuration);
        unit.addSources(files);
        unit.compile();
    }
835946
def matching_files(self):
        
        matching = []
        matcher = self.file_path_regex
        pieces = self.file_path_regex.pattern.split(sep)
        partial_matchers = list(map(re.compile, (
            sep.join(pieces[:i + 1]) for i in range(len(pieces)))))

        for root, dirs, files in walk(self.top_dir, topdown=True):
            for i in reversed(range(len(dirs))):
                dirname = relpath(join(root, dirs[i]), self.top_dir)
                dirlevel = dirname.count(sep)
                if not partial_matchers[dirlevel].match(dirname):
                    del dirs[i]

            for filename in files:
                if matcher.match(filename):
                    matching.append(abspath(join(root, filename)))

        return matching
533148
def iterSourceCode(paths):
    
    for path in paths:
        if os.path.isdir(path):
            for dirpath, dirnames, filenames in os.walk(path):
                for filename in filenames:
                    if filename.endswith('.py'):
                        yield os.path.join(dirpath, filename)
        else:
            yield path
353888
def _glob(filenames):
    
    if isinstance(filenames, string_types):
        filenames = [filenames]
    matches = []
    for name in filenames:
        matched_names = glob(name)
        if not matched_names:
            # use the original string
            matches.append(name)
        else:
            matches.extend(matched_names)
    return matches
1223444
def proto_files(root):
  """"""
  for (dirpath, _, filenames) in os.walk(root):
    for filename in filenames:
      if filename.endswith('.proto'):
        yield os.path.join(dirpath, filename)
499312
def expand_filenames(self, filenames):
        
        results = []
        for filename in filenames:
            result = filename
            if "$" in filename:
                template = Template(filename)
                result = template.substitute(**self.environment)
                logging.debug(
                    "Expanding {} to {}.".format(filename, result))
            if any([pattern in result for pattern in "*[]?"]):
                expanded = glob.glob(result)
                if len(expanded) > 0:
                    result = expanded
                else:
                    result = "NONEXISTENT"
            if isinstance(result, list):
                results.extend(result)
            else:
                results.append(result)
        return sorted(list(set(results)))
524447
function _compile(str, filename) {
    var parent = this;
    try {
      var requires = detective(str);
    } catch (ex) {
      ex.toString = function() {
        return filename + ':' + this.loc.line + '\n ' + ex.message;
      }
      throw ex;
    }
    requires.forEach(function(req) {
      if (modules.isRelative(req)) {
        Module._load(req, parent);
      } else {
        if (!modules.isCore(req)) {
          dependencies.push(modules.name(req));
        }
      }
    });
  }
974173
public function compile()
    {
        // Path prefix
        $prefix = $this->getNewPrefix();
        // List of images
        $data = $this->getList();

        // sizes
        $sizes = [];
        foreach ($this->providers as $provider) {
            if ($provider instanceof SizeProviderInterface) {
                $sizes = array_merge($sizes, $provider->getSizes());
            }
        }

        $num = 0;
        $scss = [];
        foreach ($data as $name => $list) {
            // Sprite size
            $size = !isset($sizes[$name]) ? null : $sizes[$name];
            $size = $this->getSize($name, $size);
            if (is_array($size)) {
                $border = $size[1];
                $sizeH = isset($size[2]) ? $size[2] : $size[0];
                $sizeW = $size[0];
            } else {
                $border = static::BORDER_WIDTH;
                $sizeH = $sizeW = $size;
            }
            $scss[] = $this->compileFile($prefix, $name, $list, [$sizeW, $sizeH], $border);
            $num += count($list);
        }

        // Populating template
        $template = file_get_contents($this->template);
        $scss = str_replace(
            static::TEMPLATE_NEEDLE, join("\n", $scss), $template
        );

        // Creating global classes
        if (static::CREATE_CLASSES) {
            foreach ($data as $name => $list) {
                $scss .= '.#{$' . static::NAMESPACE_NAME . '}';
                $scss .= ', .#{$' . static::NAMESPACE_NAME . '}-' . $name . ' {' . "\n";
                $scss .= '@include ' . static::PREFIX_SPRITE . $name . ';' . "\n";
                $scss .= '};' . "\n";
            }
        }

        // Writing the file
        file_put_contents($this->stylePath, $scss);

        return $num;
    }
770420
def qualified_files(self, absolute=True):
        """"""
        prefix = self.get_directory() if absolute else "."
        for rel_dir_name, file_name in self.files():
            yield os.path.join(prefix, rel_dir_name, file_name)
1215171
def translate_filenames(filenames):
    """"""
    if is_windows():
        return filenames
    for index, filename in enumerate(filenames):
        filenames[index] = vboxsf_to_windows(filename)
941066
def compile(self, source, dest, is_two_file=True, post=None, lang=None):
        """"""
        makedirs(os.path.dirname(dest))
        with io.open(dest, "w+", encoding="utf8") as out_file:
            with io.open(source, "r", encoding="utf8") as in_file:
                data = in_file.read()
            data, shortcode_deps = self.compile_string(data, source, is_two_file, post, lang)
            out_file.write(data)
        if post is None:
            if shortcode_deps:
                self.logger.error(
                    "Cannot save dependencies for post {0} (post unknown)",
                    source)
        else:
            post._depfile[dest] += shortcode_deps
        return True
931696
def _incomplete_files(filenames):
  """"""
  tmp_files = [get_incomplete_path(f) for f in filenames]
  try:
    yield tmp_files
    for tmp, output in zip(tmp_files, filenames):
      tf.io.gfile.rename(tmp, output)
  finally:
    for tmp in tmp_files:
      if tf.io.gfile.exists(tmp):
        tf.io.gfile.remove(tmp)
36684
def _generate_filenames(sources):
    
    for source in sources:
        if os.path.isdir(source):
            for path, dirlist, filelist in os.walk(source):
                for fname in filelist:
                    if GenericFilePath.is_compressed(fname):
                        if VERBOSE:
                            print("Skipping compressed file: {}".format(os.path.abspath(fname)))
                        continue
                    else:
                        yield os.path.join(path, fname)

        elif os.path.isfile(source):
            yield source

        elif source.isdigit():
            analysis_id = "AN{}".format(source.zfill(6))
            url = MWREST.format(analysis_id)
            yield url

        elif GenericFilePath.is_url(source):
            yield source

        else:
            raise TypeError("Unknown file source.")
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)
852836
def open_files(filenames):
    
    command = ['open'] + filenames
    process = Popen(command, stdout=PIPE, stderr=PIPE)
    stdout, stderr = process.communicate()
722373
def match_filenames(filenames, pattern):
    """"""
    matching = []

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

    return matching
143
def match_files(self, matched, unmatched):
        """"""
        for pattern in self.iter():
            pattern.match_files(matched, unmatched)
            if not unmatched:
                # Optimization: If we have matched all files already
                # simply return at this point - nothing else to do
                break