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

Method _parse_path

Lib/pathlib/__init__.py:282–298  ·  view source on GitHub ↗
(cls, path)

Source from the content-addressed store, hash-verified

280
281 @classmethod
282 def _parse_path(cls, path):
283 if not path:
284 return '', '', []
285 sep = cls.parser.sep
286 altsep = cls.parser.altsep
287 if altsep:
288 path = path.replace(altsep, sep)
289 drv, root, rel = cls.parser.splitroot(path)
290 if not root and drv.startswith(sep) and not drv.endswith(sep):
291 drv_parts = drv.split(sep)
292 if len(drv_parts) == 4 and drv_parts[2] not in '?.':
293 # e.g. //server/share
294 root = sep
295 elif len(drv_parts) == 6:
296 # e.g. //?/unc/server/share
297 root = sep
298 return drv, root, [x for x in rel.split(sep) if x and x != '.']
299
300 @classmethod
301 def _parse_pattern(cls, pattern):

Callers 5

driveMethod · 0.95
rootMethod · 0.95
_tailMethod · 0.95
expanduserMethod · 0.80
_check_parse_pathMethod · 0.80

Calls 5

lenFunction · 0.85
replaceMethod · 0.45
startswithMethod · 0.45
endswithMethod · 0.45
splitMethod · 0.45

Tested by 1

_check_parse_pathMethod · 0.64