(path: Path, node_ids, edges=(), *, indent=None)
| 38 | |
| 39 | |
| 40 | def _graph_file(path: Path, node_ids, edges=(), *, indent=None) -> dict: |
| 41 | data = { |
| 42 | "directed": False, "multigraph": False, "graph": {}, |
| 43 | "nodes": [_node(n) for n in node_ids], |
| 44 | "links": [{"source": s, "target": t, "relation": "calls", "confidence": "EXTRACTED", |
| 45 | "source_file": "a.py"} for s, t in edges], |
| 46 | } |
| 47 | path.parent.mkdir(parents=True, exist_ok=True) |
| 48 | path.write_text(json.dumps(data, indent=indent), encoding="utf-8") |
| 49 | return data |
| 50 | |
| 51 | |
| 52 | def _corpus(tmp_path: Path) -> Path: |
no test coverage detected