MCPcopy Create free account
hub / github.com/numpy/numpy / _isurl

Method _isurl

numpy/lib/_datasource.py:303–316  ·  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

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