def unwrap_node(node): node_class = node.__class__ if isinstance(node, BaseObject) else None node = get_node(node) return node, node_class
def __contains__(self, node): """Return whether this graph contains the given node or object (identity).""" return self.contains(get_node(node))