Load the checks defined in the specified files.
551859
def LoadChecksFromFiles(file_paths, overwrite_if_exists=True):
  """"""
  loaded = []
  for file_path in file_paths:
    configs = LoadConfigsFromFile(file_path)
    for conf in itervalues(configs):
      check = Check(**conf)
      # Validate will raise if the check doesn't load.
      check.Validate()
      loaded.append(check)
      CheckRegistry.RegisterCheck(
          check,
          source="file:%s" % file_path,
          overwrite_if_exists=overwrite_if_exists)
      logging.debug("Loaded check %s from %s", check.check_id, file_path)
  return loaded
357770
public void load() throws FileNotFoundException, IOException {
    BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
    ArrayList<String> buf = new ArrayList<>();
    while (is.ready()) {
      String line = is.readLine();
      // skip comments
      if (line.startsWith(COMMENT_PREFIX)) {
        continue;
      }
      if (line.length() == 0 && !buf.isEmpty()) {
        String title = buf.remove(0);
        store.add(new Pair<>(title, buf));
        buf = new ArrayList<>();
      } else {
        buf.add(line);
      }
    }
    if (!buf.isEmpty()) {
      String title = buf.remove(0);
      store.add(new Pair<>(title, buf));
      buf = new ArrayList<>();
    }
    is.close();
  }
1150540
def _check_file(parameters):
    """"""
    (filename, args) = parameters

    if filename == '-':
        contents = sys.stdin.read()
    else:
        with contextlib.closing(
            docutils.io.FileInput(source_path=filename)
        ) as input_file:
            contents = input_file.read()

    args = load_configuration_from_file(
        os.path.dirname(os.path.realpath(filename)), args)

    ignore_directives_and_roles(args.ignore_directives, args.ignore_roles)

    for substitution in args.ignore_substitutions:
        contents = contents.replace('|{}|'.format(substitution), 'None')

    ignore = {
        'languages': args.ignore_language,
        'messages': args.ignore_messages,
    }
    all_errors = []
    for error in check(contents,
                       filename=filename,
                       report_level=args.report,
                       ignore=ignore,
                       debug=args.debug):
        all_errors.append(error)
    return (filename, all_errors)
944467
public function loadFiles()
    {
        $this->searchAllConfigFiles($this->configDir);
        
        foreach ($this->configFiles as $fileKey => $filePath) {
            $this->loadConfigFile($fileKey, $filePath);
        }
    }
1071116
def reload(self, regexes=None, **kwargs):
        
        combined = re.compile("(" + ")|(".join(regexes) + ")", re.I)
        pending_files = os.listdir(self.src_path) or []
        pending_files.sort()
        for filename in pending_files:
            if re.match(combined, filename):
                self.put(os.path.join(self.src_path, filename))
1211984
def check_files(files)
      files.each { |file| check_file(file) if file.is_a? String }
    end
83428
def load_defaults_files(files)
      # collect the class => path => value entries from each defaults file
      hash = LazyHash.new { Hash.new }
      files.enumerate { |file| load_defaults_file(file, hash) }
      hash
    end
1141548
def load(pattern=nil)
      tests = []

      # Find all tests in the tests directory
      Find.find @@conf.test_root do |path|
        # recurse into all subdirectories
        next if File.directory? path

        # filter tests by pattern if present
        if pattern
          next unless rel_path(path).match(pattern)
        end

        # ignore dotfiles
        next if File.basename(path).match(/^\..*/)

        # ignore files in ignore filter
        next if ignored?(path)

        tests << Test.new(path)
      end

      return tests
    end
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;
        }
777371
def _load_from_file(self, filename):
    """"""
    if not tf.gfile.Exists(filename):
      raise ValueError("File %s not found" % filename)
    with tf.gfile.Open(filename) as f:
      self._load_from_file_object(f)
708552
def load_checkers():
    """"""
    for loader, name, _ in pkgutil.iter_modules([os.path.join(__path__[0], 'checkers')]):
        loader.find_module(name).load_module(name)
215264
public function load()
    {
        $files = scandir($this->getPath());

        foreach($files as $file) {
            if(
                $file === "." ||
                $file === ".."
            ) {
                continue;
            }

            if(is_file($this->getPath().$file)) {
                $this->_files[$file] = $file;
            } else if(is_dir($this->getPath().$file)) {
                $this->_directories[$file] = $file;
            }
        }
    }
287334
def run(self, files, working_area):
        

        # Ensure that dictionary is ordered by check declaration order (via self.check_names)
        # NOTE: Requires CPython 3.6. If we need to support older versions of Python, replace with OrderedDict.
        results = {name: None for name in self.check_names}
        checks_root = working_area.parent
        with futures.ProcessPoolExecutor() as executor:

            # Start all checks that have no dependencies
            not_done = set(executor.submit(run_check(name, self.checks_spec, checks_root))
                           for name, _ in self.child_map[None])
            not_passed = []

            while not_done:
                done, not_done = futures.wait(not_done, return_when=futures.FIRST_COMPLETED)
                for future in done:
                    # Get result from completed check
                    result, state = future.result()
                    results[result.name] = result
                    if result.passed:
                        # Dispatch dependent checks
                        for child_name, _ in self.child_map[result.name]:
                            not_done.add(executor.submit(
                                run_check(child_name, self.checks_spec, checks_root, state)))
                    else:
                        not_passed.append(result.name)

        for name in not_passed:
            self._skip_children(name, results)

        return results.values()
189423
def _load_lines(self, filename, line_generator, suite, rules):
        """"""
        line_counter = 0
        for line in line_generator:
            line_counter += 1

            if line.category in self.ignored_lines:
                continue

            if line.category == "test":
                suite.addTest(Adapter(filename, line))
                rules.saw_test()
            elif line.category == "plan":
                if line.skip:
                    rules.handle_skipping_plan(line)
                    return suite
                rules.saw_plan(line, line_counter)
            elif line.category == "bail":
                rules.handle_bail(line)
                return suite
            elif line.category == "version":
                rules.saw_version_at(line_counter)

        rules.check(line_counter)
        return suite
316703
private void loadEnabledPermissionCheckingDirs(Configuration conf) 
      throws IOException {
    if (this.isPermissionEnabled) {
      String[] permissionCheckingDirs = 
          conf.getStrings("dfs.permissions.checking.paths", "/");
      int numDirs = permissionCheckingDirs.length;
      if (numDirs == 0) {
        return;
      }
      this.permissionEnabled = new INode[numDirs];
      int i = 0;
      for (String src : permissionCheckingDirs) {
        INode permissionEnabledNode = this.dir.getINode(src);
        if (permissionEnabledNode == null) {
          throw new IOException(
              "Non-existent path for disabling permission Checking: " + src);
        }
        permissionEnabled[i++] = permissionEnabledNode;
      }
    }
  }
1162251
def load_file(self, file_handle, data_set=0, read_data=True):
        """"""
        file_handle.seek(0, 2)
        self._file_size = file_handle.tell()
        file_handle.seek(0)
        data_segments = 0
        # seek the correct data set in fcs
        nextdata_offset = 0
        while data_segments <= data_set:
            self.read_header(file_handle, nextdata_offset)
            self.read_text(file_handle)
            if '$NEXTDATA' in self.annotation:
                data_segments += 1
                nextdata_offset = self.annotation['$NEXTDATA']
                file_handle.seek(nextdata_offset)
                if nextdata_offset == 0 and data_segments < data_set:
                    warnings.warn("File does not contain the number of data sets.")
                    break
            else:
                if data_segments != 0:
                    warnings.warn('File does not contain $NEXTDATA information.')
                break
        if read_data:
            self.read_data(file_handle)
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()