(
			self,
			directory: ty.Union[AnyStr, utils.PathLike[AnyStr], int],
			match_spec: ty.Optional[match_spec_t[AnyStr]] = None, *,
			follow_symlinks: bool = False,
			intermediate_dirs: bool = True,
			period_special: bool = True,
			recursive: bool = True
	)
Arguments
		---------
		directory
			Path to, or file descriptor of, directory to scan
		match_spec
			Matching rules for limiting the files and directories to include in
			the scan
			
			By default everything will be scanned and included.
		follow_symlinks
			Follow symbolic links while scanning?
		period_special
			The value to pass to the *period_special* argument of :class:`GlobMatcher`
			when constructing such an object from the given *match_spec*
		intermediate_dirs
			When reporting a file or directory first ensure that all containing
			directories were already reported
			
			Due to the way matching works, a matcher may only ask for its target
			files to be included but not care about the directories leading up
			to that file and this would cause the file to be reported without
			these intermediate directories to the caller as well. If you require
			these directories to be reported for consistency, this option will
			keep track of these intermediate paths and make it appear as if these
			had been included up-front.
		recursive
			Recurse into the given directory while scanning?
			
			If ``False`` this will wrap the given matcher inside
			:class:`NoRecusionAdapterMatcher` and hence prevent the scanner from
			doing any recursion.
Arguments
		---------
		directory
			Path to, or file descriptor of, directory to scan
		match_spec
			Matching rules for limiting the files and directories to include in
			the scan
			
			By default everything will be scanned and included.
		follow_symlinks
			Follow symbolic links while scanning?
		period_special
			The value to pass to the *period_special* argument of :class:`GlobMatcher`
			when constructing such an object from the given *match_spec*
		intermediate_dirs
			When reporting a file or directory first ensure that all containing
			directories were already reported
			
			Due to the way matching works, a matcher may only ask for its target
			files to be included but not care about the directories leading up
			to that file and this would cause the file to be reported without
			these intermediate directories to the caller as well. If you require
			these directories to be reported for consistency, this option will
			keep track of these intermediate paths and make it appear as if these
			had been included up-front.
		recursive
			Recurse into the given directory while scanning?
			
			If ``False`` this will wrap the given matcher inside
			:class:`NoRecusionAdapterMatcher` and hence prevent the scanner from
			doing any recursion.
Arguments --------- directory Path to or file descriptor of directory to scan match_spec Matching rules for limiting the files and directories to include in the scan By default everything will be scanned and included . follow_symlinks Follow symbolic links while scanning? period_special The value to pass to the * period_special * argument of : class : GlobMatcher when constructing such an object from the given * match_spec * intermediate_dirs When reporting a file or directory first ensure that all containing directories were already reported Due to the way matching works a matcher may only ask for its target files to be included but not care about the directories leading up to that file and this would cause the file to be reported without these intermediate directories to the caller as well . If you require these directories to be reported for consistency this option will keep track of these intermediate paths and make it appear as if these had been included up - front . recursive Recurse into the given directory while scanning? If False this will wrap the given matcher inside : class : NoRecusionAdapterMatcher and hence prevent the scanner from doing any recursion .
def __init__(
			self,
			directory: ty.Union[AnyStr, utils.PathLike[AnyStr], int],
			match_spec: ty.Optional[match_spec_t[AnyStr]] = None, *,
			follow_symlinks: bool = False,
			intermediate_dirs: bool = True,
			period_special: bool = True,
			recursive: bool = True
	) -> None:
		"""
		Arguments
		---------
		directory
			Path to, or file descriptor of, directory to scan
		match_spec
			Matching rules for limiting the files and directories to include in
			the scan
			
			By default everything will be scanned and included.
		follow_symlinks
			Follow symbolic links while scanning?
		period_special
			The value to pass to the *period_special* argument of :class:`GlobMatcher`
			when constructing such an object from the given *match_spec*
		intermediate_dirs
			When reporting a file or directory first ensure that all containing
			directories were already reported
			
			Due to the way matching works, a matcher may only ask for its target
			files to be included but not care about the directories leading up
			to that file and this would cause the file to be reported without
			these intermediate directories to the caller as well. If you require
			these directories to be reported for consistency, this option will
			keep track of these intermediate paths and make it appear as if these
			had been included up-front.
		recursive
			Recurse into the given directory while scanning?
			
			If ``False`` this will wrap the given matcher inside
			:class:`NoRecusionAdapterMatcher` and hence prevent the scanner from
			doing any recursion.
		"""
		self._close_fd = None

		# Create matcher object
		matcher: Matcher[AnyStr] = _matcher_from_spec(
			_require_spec(match_spec),
			recursive=recursive,
			period_special=period_special
		)

		# Convert directory path to string …
		if isinstance(directory, int):
			if not HAVE_FWALK:
				raise NotImplementedError("Passing a file descriptor as directory is "
				                          "not supported on this platform")

			self._generator = self._walk(
				directory,
				None,
				matcher,
				follow_symlinks,
				intermediate_dirs
			)
		else:
			directory_str = os.fspath(directory)

			# Best-effort ensure that target directory exists if it is accessed by path
			os.stat(directory_str)
			
			# … and possibly open it as a FD if this is supported by the platform
			#
			# Note: `os.fwalk` support for binary paths was only added in 3.7+.
			directory_str_or_fd: ty.Union[AnyStr, int] = directory_str
			if HAVE_FWALK and (not isinstance(directory_str, bytes) or HAVE_FWALK_BYTES):
				fd = os.open(directory_str, os.O_RDONLY | O_DIRECTORY)
				self._close_fd = directory_str_or_fd = fd

			self._generator = self._walk(
				directory_str_or_fd,
				directory_str,
				matcher,
				follow_symlinks,
				intermediate_dirs
			)
def __init__ ( self , directory : ty . Union [ AnyStr , utils . PathLike [ AnyStr ] , int ] , match_spec : ty . Optional [ match_spec_t [ AnyStr ] ] = None , * , follow_symlinks : bool = False , intermediate_dirs : bool = True , period_special : bool = True , recursive : bool = True ) -> None : self . _close_fd = None # Create matcher object matcher : Matcher [ AnyStr ] = _matcher_from_spec ( _require_spec ( match_spec ) , recursive = recursive , period_special = period_special ) # Convert directory path to string … if isinstance ( directory , int ) : if not HAVE_FWALK : raise NotImplementedError ( "Passing a file descriptor as directory is " "not supported on this platform" ) self . _generator = self . _walk ( directory , None , matcher , follow_symlinks , intermediate_dirs ) else : directory_str = os . fspath ( directory ) # Best-effort ensure that target directory exists if it is accessed by path os . stat ( directory_str ) # … and possibly open it as a FD if this is supported by the platform # # Note: `os.fwalk` support for binary paths was only added in 3.7+. directory_str_or_fd : ty . Union [ AnyStr , int ] = directory_str if HAVE_FWALK and ( not isinstance ( directory_str , bytes ) or HAVE_FWALK_BYTES ) : fd = os . open ( directory_str , os . O_RDONLY | O_DIRECTORY ) self . _close_fd = directory_str_or_fd = fd self . _generator = self . _walk ( directory_str_or_fd , directory_str , matcher , follow_symlinks , intermediate_dirs )