MCPcopy Create free account
hub / github.com/LargeWorldModel/LWM / parse_json

Method parse_json

lwm/data.py:578–586  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

576 self._total_tokens = 0
577
578 def parse_json(self, line):
579 if not line or line == '\n':
580 return None
581 try:
582 data = json.loads(line)
583 except json.decoder.JSONDecodeError:
584 print(f'Error parsing json line:\n{line}')
585 return None
586 return data
587
588 def json_iterator(self):
589 index, file_loc = self._index, self._file_loc

Callers 1

json_iteratorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected