Normalize a node label: drop surrounding ``<>`` and a trailing ``()``.
(label: str)
| 100 | |
| 101 | |
| 102 | def norm(label: str) -> str: |
| 103 | """Normalize a node label: drop surrounding ``<>`` and a trailing ``()``.""" |
| 104 | s = str(label or "").strip() |
| 105 | if s.startswith("<") and s.endswith(">"): |
| 106 | s = s[1:-1] |
| 107 | if s.endswith("()"): |
| 108 | s = s[:-2] |
| 109 | return s |
| 110 | |
| 111 | |
| 112 | class _Lines: |