MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / load_jsonl

Function load_jsonl

experiments/baselines/knowledge_entity/runner.py:138–150  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

136
137
138def load_jsonl(path: Path) -> List[Dict[str, Any]]:
139 rows: List[Dict[str, Any]] = []
140 if not path.exists():
141 return rows
142 with path.open("r", encoding="utf-8") as handle:
143 for line in handle:
144 line = line.strip()
145 if not line:
146 continue
147 payload = json.loads(line)
148 if isinstance(payload, dict):
149 rows.append(payload)
150 return rows
151
152
153def write_jsonl(path: Path, rows: Iterable[Dict[str, Any]]) -> None:

Callers 2

run_baselineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected