MCPcopy Index your code
hub / github.com/numpy/numpy / _isurl

Method _isurl

numpy/lib/_datasource.py:299–312  ·  view source on GitHub ↗

Test if path is a net location. Tests the scheme and netloc.

(self, path)

Source from the content-addressed store, hash-verified

297 return names
298
299 def _isurl(self, path):
300 """Test if path is a net location. Tests the scheme and netloc."""
301
302 # We do this here to reduce the 'import numpy' initial import time.
303 from urllib.parse import urlparse
304
305 # BUG : URLs require a scheme string ('http://') to be used.
306 # www.google.com will fail.
307 # Should we prepend the scheme for those that don't have it and
308 # test that also? Similar to the way we append .gz and test for
309 # for compressed versions of files.
310
311 scheme, netloc, upath, uparams, uquery, ufrag = urlparse(path)
312 return bool(scheme and netloc)
313
314 def _cache(self, path):
315 """Cache the file specified by path.

Callers 5

_cacheMethod · 0.95
_findfileMethod · 0.95
existsMethod · 0.95
openMethod · 0.95
listdirMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected