MCPcopy
hub / github.com/hugapi/hug / _internal_result

Function _internal_result

hug/test.py:39–52  ·  view source on GitHub ↗
(raw_response)

Source from the content-addressed store, hash-verified

37
38
39def _internal_result(raw_response):
40 try:
41 return raw_response[0].decode("utf8")
42 except TypeError:
43 data = BytesIO()
44 for chunk in raw_response:
45 data.write(chunk)
46 data = data.getvalue()
47 try:
48 return data.decode("utf8")
49 except UnicodeDecodeError: # pragma: no cover
50 return data
51 except (UnicodeDecodeError, AttributeError):
52 return raw_response[0]
53
54
55def call(

Callers 2

callFunction · 0.85
cliFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected