Check given paths asynchronously.

    :return list: list of errors
507318
def check_async(paths, options, rootdir=None):
    
    LOGGER.info('Async code checking is enabled.')
    path_queue = Queue.Queue()
    result_queue = Queue.Queue()

    for num in range(CPU_COUNT):
        worker = Worker(path_queue, result_queue)
        worker.setDaemon(True)
        LOGGER.info('Start worker #%s', (num + 1))
        worker.start()

    for path in paths:
        path_queue.put((path, dict(options=options, rootdir=rootdir)))

    path_queue.join()

    errors = []
    while True:
        try:
            errors += result_queue.get(False)
        except Queue.Empty:
            break

    return errors
154581
function readCerts(paths, done) {
    if (!(paths instanceof Array))
        throw new TypeError("readCertsSync expects Array argument");

    async.map(paths, fs.readFile, function(err, files) {
        var opts = {};

        if (err) done(err);
        else switch (files.length) {
            case 1:
                opts.pfx = files[0];
                break;
            case 2:
                opts.cert = files[0];
                opts.key = files[1];
                break;
            default:
                opts.cert = files[0];
                opts.key = files[1];
                opts.ca = files.slice(2);
        }

        done(null, opts);
    });
}
1077790
def __validate_and_fix_path(path, check_file=False, check_dir=False):
    """"""
    # pylint: disable=superfluous-parens
    if path is None:
        return path
    else:
        if not (os.path.isfile(path) if check_file else False) \
                and not (os.path.isdir(path) if check_dir else False):
            raise SystemExit('Path `%s` does not exist' % path)
        if not os.path.isabs(path):
            path = os.path.abspath(os.path.join(os.path.abspath(os.curdir), path))

    return path
895986
def dirs(self, paths, access=None):
        """"""
        self.failures = [path for path in paths if not
                         isvalid(path, access, filetype='dir')]

        return not self.failures
935568
def check_list_errors(self, checkFunc, lst):
        """"""
        # check for errors on each subitem, filter only subitems with errors
        results = (checkFunc(i) for i in lst)
        return [err for err in results if err]
1170275
def obtain_check_classes(self):
        
        check_classes = set()
        for path in self.paths:
            for root, _, files in os.walk(path):
                for fi in files:
                    if not fi.endswith(".py"):
                        continue
                    path = os.path.join(root, fi)
                    check_classes = check_classes.union(set(
                        load_check_classes_from_file(path)))
        return list(check_classes)
833660
def get_requires(path=REQUIRE_PATH):
    
    for line in read(path).splitlines():
        line = line.strip()
        if line and not line.startswith('#'):
            yield line
561833
def scan(cls, path):
        
        result = []
        try:
            for _p in listdir(path):
                try:
                    result.append(Template(_p, op.join(path, _p)))
                except ValueError:
                    continue
        except OSError:
            pass

        return result
81481
def get_works(self):
        
        return [os.path.split(filepath)[1] for filepath in
                glob.glob(os.path.join(self._path, '*'))
                if os.path.isdir(filepath)]
1130282
def findAllExceptions(pathToCheck):
    
    finder = PatternFinder()
    if os.path.isfile(pathToCheck):
        with open(pathToCheck) as f:
            findPatternsInFile(f.read(), finder)
    else:
        for path, dirs, files in os.walk(pathToCheck):
            for file in files:
                _, extname = os.path.splitext(file)
                if extname == ".py":
                    pathFile = os.path.join(path, file)
                    with open(pathFile) as f:
                        findPatternsInFile(f.read(), finder)
    return finder.patternsFunc, finder.patternsClass
311004
def check_path(path, otherwise):
    

    if os.path.exists(path):
        print("WARNING: Path '%s' already exists; skipping" % path)
    else:
        otherwise(path)
452013
function getPaths() {
  return new Promise((resolve, reject) => {
    let paths = [];

    const walker = walk(sourceDir);
    walker.on('file', (root, stats, next) => {
      const sourcePath = path.join(root, stats.name);
      if (/\.js$/.test(sourcePath)) {
        paths.push(sourcePath);
      }
      next();
    });
    walker.on('errors', () => {
      reject(new Error(`Trouble walking ${sourceDir}`));
    });

    walker.on('end', () => {
      /**
       * Windows has restrictions on length of command line, so passing all the
       * changed paths to a task will fail if this limit is exceeded.
       * To get round this, if this is Windows and there are newer files, just
       * pass the sourceDir to the task so it can do the walking.
       */
      if (isWindows) {
        paths = [sourceDir];
      }

      resolve(paths);
    });
  });
}
1176679
private static void checkPaths(Configuration conf, List<Path> paths) throws
  IOException {
    for (Path p : paths) {
      FileSystem fs = p.getFileSystem(conf);
      if (!fs.exists(p)) {
        throw new FileNotFoundException("Source " + p + " does not exist.");
      }
    }
  }
1017700
function checkRequiredFiles(files) {
  try {
    files.forEach(filePath => {
      fs.accessSync(filePath, fs.F_OK);
    });
    return true;
  } catch (err) {
    return false;
  }
}
481908
def check(path=None, env='default'):
    
    # TODO: add files=<list of files> to check only a subset...
    # also useful for 'quilt build' to exclude certain files?
    # (if not, then require dry_run=True if files!=None/all)
    build("dry_run/dry_run", path=path, dry_run=True, env=env)
843472
function getExistsSync(path, exts) {
    for (var i=0,len=exts.length; i<len; i++) {
        if (fs.existsSync(path + exts[i])) {
            return path + exts[i];
        }
    }
    return false;
}
261915
function getPathsToSync(fs, path, callback) {
  getAttr(fs, path, constants.attributes.pathsToSync, callback);
}