download
raw
845 Bytes
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import io
import json
from typing import List
CONTENT_LENGTH: str = "Content-Length:"
def process_rpc_json(data: str) -> List[str]:
"""Process the JSON data which comes from the server."""
str_stream: io.StringIO = io.StringIO(data)
length: int = 0
while True:
line: str = str_stream.readline()
if CONTENT_LENGTH.lower() in line.lower():
length = int(line[len(CONTENT_LENGTH) :])
break
if not line or line.isspace():
raise ValueError("Header does not contain Content-Length")
while True:
line: str = str_stream.readline()
if not line or line.isspace():
break
raw_json: str = str_stream.read(length)
return json.loads(raw_json)

Xet Storage Details

Size:
845 Bytes
·
Xet hash:
d370391ad9436b5ff2496cf00ea10632dc9028c47f48359237b649a94ebb583e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.