MCPcopy Create free account
hub / github.com/alibaba/GraphScope / get_string

Method get_string

python/graphscope/client/archive.py:70–83  ·  view source on GitHub ↗

Peek a string. Get string's length first (stored as a size_t), then get number of bytes equivalents to the length. Default using utf-8 to decode, if there is any bytes cannot be converted, 'errors="backslashreplace' inserts a escape sequence.So these special b

(self)

Source from the content-addressed store, hash-verified

68 return byt
69
70 def get_string(self):
71 """Peek a string.
72 Get string's length first (stored as a size_t), then get number of bytes
73 equivalents to the length.
74 Default using utf-8 to decode, if there is any bytes cannot be converted,
75 'errors="backslashreplace' inserts a escape sequence.So these special
76 bytes can be reserved.
77 Ref:https://docs.python.org/3/howto/unicode.html?highlight=bytes%20decode
78 """
79 size = self.get_size()
80 string = (
81 self.get_block(size).tobytes().decode("utf-8", errors="backslashreplace")
82 )
83 return string
84
85 def get_int(self):
86 """Peek a int."""

Callers 2

decode_numpyFunction · 0.95
decode_dataframeFunction · 0.95

Calls 3

get_sizeMethod · 0.95
get_blockMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected