| 162 | return s[len(self.root):] if s.startswith(self.root) else s |
| 163 | |
| 164 | def _lines(self, e: dict, src_file: str) -> set[int]: |
| 165 | lines: set[int] = set() |
| 166 | for ev in (e, *[a for a in (e.get("also_seen") or []) if isinstance(a, dict)]): |
| 167 | if ev is not e and ev.get("source_file") not in (None, "") and self.rel(ev["source_file"]) != src_file: |
| 168 | continue |
| 169 | m = re.fullmatch(r"L(\d+)", str(ev.get("source_location") or "")) |
| 170 | if m: |
| 171 | lines.add(int(m.group(1))) |
| 172 | return lines |
| 173 | |
| 174 | def targets(self, file: str, line: int) -> list[dict]: |
| 175 | """Destination nodes of every edge seen at ``file:line``.""" |