MCPcopy Index your code
hub / github.com/python/cpython / glob

Method glob

Lib/zipfile/_path/__init__.py:421–428  ·  view source on GitHub ↗
(self, pattern)

Source from the content-addressed store, hash-verified

419 return stat.S_ISLNK(mode)
420
421 def glob(self, pattern):
422 if not pattern:
423 raise ValueError(f"Unacceptable pattern: {pattern!r}")
424
425 prefix = re.escape(self.at)
426 tr = Translator(seps='/')
427 matches = re.compile(prefix + tr.translate(pattern)).fullmatch
428 return map(self._next, filter(matches, self.root.namelist()))
429
430 def rglob(self, pattern):
431 return self.glob(f'**/{pattern}')

Callers 1

rglobMethod · 0.95

Calls 6

translateMethod · 0.95
TranslatorClass · 0.85
escapeMethod · 0.80
filterFunction · 0.50
compileMethod · 0.45
namelistMethod · 0.45

Tested by

no test coverage detected