Returns a list of formatter classes which would accept the file given by *path*. When no classes
    could be found and *silent* is *True*, an empty list is returned. Otherwise, an exception is
    raised.
543676
def find_formatters(path, silent=True):
    
    formatters = [f for f in six.itervalues(FormatterRegister.formatters) if f.accepts(path)]
    if formatters or silent:
        return formatters
    else:
        raise Exception("cannot find formatter for path '{}'".format(path))
1156594
private static void getClassPathesFromClassLoader(URLClassLoader ucl, ArrayList<Resource> pathes) {
	ClassLoader pcl = ucl.getParent();
	// parent first
	if (pcl instanceof URLClassLoader) getClassPathesFromClassLoader((URLClassLoader) pcl, pathes);

	ResourceProvider frp = ResourcesImpl.getFileResourceProvider();
	// get all pathes
	URL[] urls = ucl.getURLs();
	for (int i = 0; i < urls.length; i++) {
	    Resource file = frp.getResource(urls[i].getPath());
	    if (file.exists()) pathes.add(ResourceUtil.getCanonicalResourceEL(file));
	}

    }
1245013
def list(cls, path):
        
        file_info = cls.parse_remote(path)
        connection = cls.connect(path)
        bucket = connection.get_bucket(file_info.bucket)
        region = "@%s" % file_info.region if file_info.region else ""

        output = []
        for key in bucket.get_all_keys(prefix=file_info.key):
            output.append(cls._S3_FILE % {"bucket": file_info.bucket,
                                          "key": key.name,
                                          "region": region})
        return output
579947
private static void getClassPathesFromLoader(ClassLoader cl, Map pathes) {
	if (cl instanceof URLClassLoader) _getClassPathesFromLoader((URLClassLoader) cl, pathes);
    }
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)
842873
protected List<File> getClassPath() throws IOException {
		final Set<String> classPath = new LinkedHashSet<>();
		classPath.add(this.session.getCurrentProject().getBuild().getSourceDirectory());
		try {
			classPath.addAll(this.session.getCurrentProject().getCompileClasspathElements());
		} catch (DependencyResolutionRequiredException e) {
			throw new IOException(e.getLocalizedMessage(), e);
		}
		for (final Artifact dep : this.session.getCurrentProject().getArtifacts()) {
			classPath.add(dep.getFile().getAbsolutePath());
		}
		classPath.remove(this.session.getCurrentProject().getBuild().getOutputDirectory());
		final List<File> files = new ArrayList<>();
		for (final String filename : classPath) {
			final File file = new File(filename);
			if (file.exists()) {
				files.add(file);
			}
		}
		return files;
	}
965732
public static Collection<String> listFiles(ClassLoader classLoader, String rootPath) {
    return listResources(classLoader, rootPath, path -> !StringUtils.endsWith(path, "/"));
  }
1295252
def get_list_of_paths(self):
        
        all_paths = []
        for p in self.fl_metadata:
            try:
                all_paths.append(p['path'])
            except:
                try:
                    print('cls_filelist - no key path, ignoring folder ' + str(p))
                except:
                    print('cls_filelist - no key path, ignoring odd character folder')

        return list(set(all_paths))
1121255
def from_folder(cls, path:PathOrStr, train:str='train', valid:str='valid', test:Optional[str]=None,
                    classes:Collection[Any]=None, tokenizer:Tokenizer=None, vocab:Vocab=None, chunksize:int=10000, max_vocab:int=60000,
                    min_freq:int=2, mark_fields:bool=False, include_bos:bool=True, include_eos:bool=False, **kwargs):
        ""
        path = Path(path).absolute()
        processor = [OpenFileProcessor()] + _get_processor(tokenizer=tokenizer, vocab=vocab, chunksize=chunksize, max_vocab=max_vocab,
                                   min_freq=min_freq, mark_fields=mark_fields, include_bos=include_bos, include_eos=include_eos)
        src = (TextList.from_folder(path, processor=processor)
                       .split_by_folder(train=train, valid=valid))
        src = src.label_for_lm() if cls==TextLMDataBunch else src.label_from_folder(classes=classes)
        if test is not None: src.add_test_folder(path/test)
        return src.databunch(**kwargs)
1201134
def get_formatter_by_name(_alias, **options):
    
    cls = find_formatter_class(_alias)
    if cls is None:
        raise ClassNotFound("no formatter found for name %r" % _alias)
    return cls(**options)
350208
@NullSafe
  static File[] safeListFiles(File path, FileFilter fileFilter) {
    return (isDirectory(path) ? path.listFiles(fileFilter) : NO_FILES);
  }
780340
protected List<File> findEntityClassFiles() throws MojoExecutionException {
        try {
            return FileUtils.getFiles(classes, includes, excludes);
        } catch (IOException e) {
            throw new MojoExecutionException("Error while scanning for '" + includes + "' in " + "'"
                    + classes.getAbsolutePath() + "'.", e);
        }
    }
1147249
private void parsePackageClasses(String name,
            List<JavaFileObject> files,
            ListBuffer<JCCompilationUnit> trees,
            List<String> excludedPackages)
            throws IOException {
        if (excludedPackages.contains(name)) {
            return;
        }

        docenv.notice("main.Loading_source_files_for_package", name);

        if (files == null) {
            Location location = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                    ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;
            ListBuffer<JavaFileObject> lb = new ListBuffer<JavaFileObject>();
            for (JavaFileObject fo: docenv.fileManager.list(
                    location, name, EnumSet.of(JavaFileObject.Kind.SOURCE), false)) {
                String binaryName = docenv.fileManager.inferBinaryName(location, fo);
                String simpleName = getSimpleName(binaryName);
                if (isValidClassName(simpleName)) {
                    lb.append(fo);
                }
            }
            files = lb.toList();
        }
        if (files.nonEmpty()) {
            for (JavaFileObject fo : files) {
                parse(fo, trees, false);
            }
        } else {
            messager.warning(Messager.NOPOS, "main.no_source_files_for_package",
                             name.replace(File.separatorChar, '.'));
        }
    }
789795
function (path) {
    let classes = [];

    let files = fs.readdirSync(path);
    for (let i = 0; i < files.length; i++) {
      let clazz = require(path + '/' + files[i]);
      classes.push(clazz);
    }

    return classes;
  }
116589
def silenced?(relative_path, _type)
      path = relative_path.to_s

      # if only_patterns && type == :file
      #   return true unless only_patterns.any? { |pattern| path =~ pattern }
      # end

      return only_patterns.none? { |pattern| path =~ pattern } if only_patterns

      ignore_patterns.any? { |pattern| path =~ pattern }
    end
1189289
public static <T> List<T> getNullableList(final List list, final Class<T> clazz, final Integer... path) {
        return (List<T>) getNullable(list, List.class, path);
    }
311931
public List<FileInfo> getFileInfos(List<URI> paths) throws IOException {
    checkArgument(paths != null, "paths must not be null");
    logger.atFine().log("getFileInfos(%d paths)", paths.size());

    if (paths.size() == 1) {
      return new ArrayList<>(Collections.singleton(getFileInfo(paths.get(0))));
    }

    int maxThreads = gcs.getOptions().getBatchThreads();
    ExecutorService fileInfoExecutor =
        maxThreads == 0
            ? MoreExecutors.newDirectExecutorService()
            : Executors.newFixedThreadPool(
                Math.min(maxThreads, paths.size()), DAEMON_THREAD_FACTORY);
    try {
      List<Future<FileInfo>> infoFutures = new ArrayList<>(paths.size());
      for (URI path : paths) {
        infoFutures.add(fileInfoExecutor.submit(() -> getFileInfo(path)));
      }
      fileInfoExecutor.shutdown();

      List<FileInfo> infos = new ArrayList<>(paths.size());
      for (Future<FileInfo> infoFuture : infoFutures) {
        try {
          infos.add(infoFuture.get());
        } catch (InterruptedException | ExecutionException e) {
          if (e instanceof InterruptedException) {
            Thread.currentThread().interrupt();
          }
          throw new IOException(
              String.format("Failed to getFileInfos for %d paths", paths.size()), e);
        }
      }
      return infos;
    } finally {
      fileInfoExecutor.shutdownNow();
    }
  }