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

Method get_data

Lib/importlib/_bootstrap_external.py:947–954  ·  view source on GitHub ↗

Return the data from path as raw bytes.

(self, path)

Source from the content-addressed store, hash-verified

945 return self.path
946
947 def get_data(self, path):
948 """Return the data from path as raw bytes."""
949 if isinstance(self, (SourceLoader, ExtensionFileLoader)):
950 with _io.open_code(str(path)) as file:
951 return file.read()
952 else:
953 with _io.FileIO(path, 'r') as file:
954 return file.read()
955
956 @_check_name
957 def get_resource_reader(self, module):

Callers 1

get_codeMethod · 0.45

Calls 3

isinstanceFunction · 0.85
strFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected