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

Method get_bytes

Lib/mailbox.py:849–856  ·  view source on GitHub ↗

Return a string representation or raise a KeyError.

(self, key, from_=False)

Source from the content-addressed store, hash-verified

847 self.get_bytes(key, from_)).as_string(unixfrom=from_)
848
849 def get_bytes(self, key, from_=False):
850 """Return a string representation or raise a KeyError."""
851 start, stop = self._lookup(key)
852 self._file.seek(start)
853 if not from_:
854 self._file.readline()
855 string = self._file.read(stop - self._file.tell())
856 return string.replace(linesep, b'\n')
857
858 def get_file(self, key, from_=False):
859 """Return a file-like representation or raise a KeyError."""

Callers 1

get_stringMethod · 0.95

Calls 6

_lookupMethod · 0.45
seekMethod · 0.45
readlineMethod · 0.45
readMethod · 0.45
tellMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected