MCPcopy Index your code
hub / github.com/zai-org/CodeGeeX2 / stream_jsonl_all

Function stream_jsonl_all

evaluation/utils.py:196–207  ·  view source on GitHub ↗
(filename: str)

Source from the content-addressed store, hash-verified

194
195
196def stream_jsonl_all(filename: str) -> Iterable[Dict]:
197 results = []
198 if filename.endswith(".gz"):
199 fp = gzip.open(open(filename, "rb"), "rt")
200 else:
201 fp = open(filename, "r")
202 for line in fp:
203 if any(not x.isspace() for x in line):
204 results.append(json.loads(line))
205 fp.close()
206
207 return results
208
209
210def read_dataset(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected