Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Matches the files to the patterns.

*patterns* (``Iterable`` of ``pathspec.Pattern``) contains the
patterns to use.

*files* (``Iterable`` of ``str``) contains the files to be matched
against *patterns*.

Returns the matched files (``set`` of ``str``).

        def match_files(patterns, files):
	"""
	Matches the files to the patterns.

	*patterns* (``Iterable`` of ``pathspec.Pattern``) contains the
	patterns to use.

	*files* (``Iterable`` of ``str``) contains the files to be matched
	against *patterns*.

	Returns the matched files (``set`` of ``str``).
	"""
	all_files = files if isinstance(files, collections.Container) else list(files)
	return_files = set()
	for pattern in patterns:
		if pattern.include is not None:
			result_files = pattern.match(all_files)
			if pattern.include:
				return_files.update(result_files)
			else:
				return_files.difference_update(result_files)
	return return_files
        


src/p/a/pathspec-0.2.2/pathspec/__init__.py   pathspec(Download)
from .pathspec import PathSpec
from .pattern import Pattern, RegexPattern
from .util import iter_tree, match_files, RecursionError