MCPcopy Index your code
hub / github.com/RustPython/RustPython / glob

Method glob

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

Source from the content-addressed store, hash-verified

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

Callers 1

rglobMethod · 0.95

Calls 6

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

Tested by

no test coverage detected