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

Method is_absolute

Lib/pathlib/__init__.py:505–514  ·  view source on GitHub ↗

True if the path is absolute (has both a root and, if applicable, a drive).

(self)

Source from the content-addressed store, hash-verified

503 return other == self or other in self.parents
504
505 def is_absolute(self):
506 """True if the path is absolute (has both a root and, if applicable,
507 a drive)."""
508 if self.parser is posixpath:
509 # Optimization: work with raw paths on POSIX.
510 for path in self._raw_paths:
511 if path.startswith('/'):
512 return True
513 return False
514 return self.parser.isabs(self)
515
516 def is_reserved(self):
517 """Return True if the path contains one of the special names reserved

Callers 12

as_uriMethod · 0.95
absoluteMethod · 0.80
as_uriMethod · 0.80
from_uriMethod · 0.80
test_uri_windowsMethod · 0.80
_test_cwdMethod · 0.80
_test_homeMethod · 0.80
find_eq.pyFile · 0.80
check_dirFunction · 0.80

Calls 1

startswithMethod · 0.45

Tested by 5

test_uri_windowsMethod · 0.64
_test_cwdMethod · 0.64
_test_homeMethod · 0.64