MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / read_utf8

Function read_utf8

vmm/src/vmm-cli.py:343–346  ·  view source on GitHub ↗

Read a file and return its contents as a UTF-8 string.

(filepath: str)

Source from the content-addressed store, hash-verified

341
342
343def read_utf8(filepath: str) -> str:
344 """Read a file and return its contents as a UTF-8 string."""
345 with open(filepath, "rb") as f:
346 return f.read().decode("utf-8")
347
348
349class UnixSocketHTTPConnection(http.client.HTTPConnection):

Callers 2

create_vmMethod · 0.85
mainFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected