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

Function load_jsonl

experiments/baselines/citation_enhanced/runner.py:89–101  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

87
88
89def load_jsonl(path: Path) -> List[Dict[str, Any]]:
90 rows: List[Dict[str, Any]] = []
91 if not path.exists():
92 return rows
93 with path.open("r", encoding="utf-8") as handle:
94 for line in handle:
95 line = line.strip()
96 if not line:
97 continue
98 payload = json.loads(line)
99 if isinstance(payload, dict):
100 rows.append(payload)
101 return rows
102
103
104def 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