process a list of files, return 1 if one or more error occurred
497875
function(filename, options) {
    var input = readFile(filename),
        result = CSSLint.verify(input, gatherRules(options)),
        formatId = options.format || "text",
        messages = result.messages || [],
        exitCode = 0;

    if (!input) {
        print("csslint: Could not read file data in " + filename + ". Is the file empty?");
        exitCode = 1;
    } else {
        print(CSSLint.getFormatter(formatId).formatResults(result, filename, formatId));

        if (messages.length > 0 && pluckByType(messages, 'error').length > 0) {
            exitCode = 1;
        }
    }
    
    return exitCode;
}
886732
def process_pattern(fn):
    
    directory, pattern = validate_pattern(fn)
    if directory is not None:
        filenames = fnmatch.filter(auto(listdir, directory), pattern)
        if filenames:
            return [directory + '/' + sfn for sfn in filenames]
        else:
            print_err("cannot access '{}': No such file or directory".format(fn))
589232
function(err) {
                if (err) {
                    // eslint-disable-next-line no-console
                    console.log("\n");
                    return Promise.reject(err);
                }

                // Get 20 files
                let _files = filesNames.splice(0, batch);

                if (_files.length) {
                    return Promise.all(_files.map(performUpload)).then(() => execStack(), execStack);
                } else {
                    return Promise.resolve();
                }
            }
89747
function excludeFiles(list, regex) {
        var ret = [];
        for (var i=0; i < list.length; i++) {
            if (!regex.test(list[i].dst)) {
                ret.push(list[i]);
            }
        }
        return ret;
    }
188383
def get_file_starts(file_list):
    '''
    
    '''
    starts = []
    total = 0
    for i in file_list:
        starts.append(total)
        total += i['length']
    print starts
    return starts
834108
def rmtree_errorhandler(func, path, exc_info):
    """"""
    # if file type currently read only
    if os.stat(path).st_mode & stat.S_IREAD:
        # convert to read/write
        os.chmod(path, stat.S_IWRITE)
        # use the original function to repeat the operation
        func(path)
        return
    else:
        raise
108592
def check_dir(directory, newly_created_files):
  """"""
  header_parse_failures = []
  for root, dirs, files in os.walk(directory):
    for f in files:
      if f.endswith('.py') and os.path.basename(f) != '__init__.py':
        filename = os.path.join(root, f)
        try:
          check_header(filename, filename in newly_created_files)
        except HeaderCheckFailure as e:
          header_parse_failures.append(e.message)
  return header_parse_failures
557130
function processArgs(args, files = []) {
  return args.reduce((acc, arg) => {
    let stats;
    try {
      stats = fs.statSync(arg);
    } catch (err) {
      // Do nothing
    }

    // If argument is a directory, process the files inside
    if (stats && stats.isDirectory()) {
      return processArgs(
        fs.readdirSync(arg).map(file => path.join(arg, file)),
        files
      );
    }

    // If `statSync` failed, validating will handle the error
    // If the argument is a file, check if its a JSON file before validating
    if (!stats || JsonFileRegex.test(arg)) {
      acc.push(validateFile(arg));
    }

    return acc;
  }, files);
}
1279706
private static void find(List<File> files, File path, Boolean recursive) {
        if (path.isDirectory()) {
            // iterate over files
            for (File file : path.listFiles()) {
                if (recursive || !file.isDirectory()) {
                    find(files, file, recursive);
                }
            }
        } else {
            // process the file
            files.add(path);
        }
    }
1297409
def run(files, temp_folder):
    ""
    errors = []
    for py_file in filter_python_files(files):
        # We only want to show errors if we CAN'T compile to py3.
        # but we want to show all the errors at once.
        b = bash('python3 -m py_compile {0}'.format(py_file))
        if b.stderr:
            b = bash('2to3-2.7 {file}'.format(file=py_file))
            errors.append(b.value())
    return "\n".join(errors)
1036702
def check_file_paths(self, *args):
        
        for path in enumerate(args):
            path = path[1]
            if path is not None:
                try:
                    self.check_file_path(path)
                except OSError as ex:
                    logger.warn(ex)
                    raise
        return args
334423
def error(self, line_number, offset, text, check):
        """"""
        code = text[:4]
        if self._ignore_code(code):
            return
        if code in self.counters:
            self.counters[code] += 1
        else:
            self.counters[code] = 1
            self.messages[code] = text[5:]
        # Don't care about expected errors or warnings
        if code in self.expected:
            return
        if self.print_filename and not self.file_errors:
            print(self.filename)
        self.file_errors += 1
        self.total_errors += 1
        return code
398460
function walk(files, cb, list) {
    var i = 0;
    list = list || [];

    function check(file, cb) {
      fs.stat(file, function onStat(err, stats) {
        if(err) return cb(err);
        if(stats.isFile() && !/\.js$/.test(file)) {
          log.warning('ignoring %s', file);
          return cb();
        }
        if(stats.isFile()) {
          list.push(file);
          return cb(null, list);
        }else{
          return fs.readdir(file, function onRead(err, files) {
            if(err) return cb(err);
            if(!files.length) return cb();
            files = files.map(function(nm) {
              return path.join(file, nm);
            })
            //files.forEach()
            return walk(files, cb, list);
          })
        }
      });
    }

    check(files[i], function onCheck(err, list) {
      if(err) return cb(err);
      if(i === files.length - 1) {
        return cb(null, list);
      }
      i++;
      check(files[i], onCheck);
    });
  }
1269622
def file_list( files )
    case files
    when String
      [files]
    when Array
      files
    when Proc
      files.call # result should respond to #each
    else
      []
    end
  end
893632
def read_files(filenames):
    """"""
    if isinstance(filenames, list):
        for filename in filenames:
            with open(filename, 'r') as infile:
                return infile.read()
    else:
        with open(filenames, 'r') as infile:
            return infile.read()
1011530
function processFile(options, callback) {
  return fs.readFile(options.path, function(err, data) {
    if (err) {
      return callback(err);
    }
    return callback(null, data);
  });
}
26811
def process_inputs(self):
        
        ret = []
        files = self.args.files
        if files is None:
            return ret

        for fname in files:

            # arguments are host specs
            if self.args.hosts:
                sub = self.process_host(fname, fname, 0)
                if sub is not None:
                    ret.append(sub)
                continue

            # arguments are file names
            fh = open(fname, 'r')
            with fh:
                data = fh.read()
                sub = self.process_tls(data, fname)
                ret.append(sub)

        return ret