def METHOD_NAME(self, mid: MID, uid: Optional[str], node: Any):
    assert isinstance(mid, MID), mid
    assert mid not in self._map_mid_to_node, (self._map_mid_to_node, node)
    self._map_mid_to_node[mid] = node
    if uid is not None:
        self._map_uid_to_node[uid] = node