| 98 | |
| 99 | |
| 100 | class NodeMetadata: |
| 101 | def __init__(self, data: Dict[str, Any]) -> None: |
| 102 | self.data: Dict[str, Any] = data.copy() |
| 103 | |
| 104 | def __getitem__(self, key: str) -> NodeMetadataValue: |
| 105 | return self.data[key] |
| 106 | |
| 107 | def __setitem__(self, key: str, value: NodeMetadataValue) -> NodeMetadataValue: |
| 108 | if key in PROTECTED_KEYS: |
| 109 | raise RuntimeError(f"Could not override node key: {key}") |
| 110 | self.data[key] = value |
| 111 | |
| 112 | def __contains__(self, key: str) -> bool: |
| 113 | return key in self.data |
| 114 | |
| 115 | def copy(self) -> "NodeMetadata": |
| 116 | return NodeMetadata(self.data.copy()) |
| 117 | |
| 118 | |
| 119 | class ProxyValue: |
no outgoing calls