MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / jsonl_expander

Function jsonl_expander

SwissArmyTransformer/sat/data_utils/jsonlds.py:51–59  ·  view source on GitHub ↗
(streams)

Source from the content-addressed store, hash-verified

49 )
50
51def jsonl_expander(streams):
52 for source in streams:
53 for line in source['stream']:
54 sample = json.loads(line)
55 sample['__url__'] = source['url']
56 for k,v in sample.items():
57 if v is None:
58 sample[k] = ''
59 yield sample
60
61def jsonl_samples(src, handler=reraise_exception):
62 streams = url_opener(src, handler=handler)

Callers 1

jsonl_samplesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected