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

Method _load

numpy/lib/_datasource.py:103–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 self._file_openers = {None: io.open}
102
103 def _load(self):
104 if self._loaded:
105 return
106
107 try:
108 import bz2
109 self._file_openers[".bz2"] = bz2.open
110 except ImportError:
111 pass
112
113 try:
114 import gzip
115 self._file_openers[".gz"] = gzip.open
116 except ImportError:
117 pass
118
119 try:
120 import lzma
121 self._file_openers[".xz"] = lzma.open
122 self._file_openers[".lzma"] = lzma.open
123 except (ImportError, AttributeError):
124 # There are incompatible backports of lzma that do not have the
125 # lzma.open attribute, so catch that as well as ImportError.
126 pass
127
128 self._loaded = True
129
130 def keys(self):
131 """

Callers 2

keysMethod · 0.95
__getitem__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected