(reverse: bool = False)
| 36 | |
| 37 | |
| 38 | def _graph_data(reverse: bool = False) -> dict: |
| 39 | nodes = [ |
| 40 | {"id": i, "label": lbl, "source_file": sf, "source_location": loc} |
| 41 | for i, lbl, sf, loc in _NODES |
| 42 | ] |
| 43 | return { |
| 44 | "directed": False, "multigraph": False, "graph": {}, |
| 45 | "nodes": list(reversed(nodes)) if reverse else nodes, |
| 46 | "links": [ |
| 47 | {"source": a, "target": b, "relation": rel, "confidence": "EXTRACTED"} |
| 48 | for a, b, rel in _LINKS |
| 49 | ], |
| 50 | } |
| 51 | |
| 52 | |
| 53 | def _write(tmp_path, reverse: bool = False): |
no outgoing calls
no test coverage detected