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

Method as_uri

Lib/pathlib/__init__.py:1264–1269  ·  view source on GitHub ↗

Return the path as a URI.

(self)

Source from the content-addressed store, hash-verified

1262 return cls(homedir)
1263
1264 def as_uri(self):
1265 """Return the path as a URI."""
1266 if not self.is_absolute():
1267 raise ValueError("relative paths can't be expressed as file URIs")
1268 from urllib.request import pathname2url
1269 return pathname2url(str(self), add_scheme=True)
1270
1271 @classmethod
1272 def from_uri(cls, uri):

Callers 2

make_uriMethod · 0.45
_normalize_uriFunction · 0.45

Calls 3

pathname2urlFunction · 0.90
strFunction · 0.85
is_absoluteMethod · 0.80

Tested by 1

make_uriMethod · 0.36