def __contains__(self, key):
if isinstance(key, int):<EOL><INDENT>for node in self.__nodes:<EOL><INDENT>if node.node_id == key:<EOL><INDENT>return True<EOL><DEDENT><DEDENT><DEDENT>if isinstance(key, Node):<EOL><INDENT>for node in self.__nodes:<EOL><INDENT>if node == key:<EOL><INDENT>return True<EOL><DEDENT><DEDENT><DEDENT>for node in self.__nodes:<EOL><INDENT>if node.name == key:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL>
Check if key is in index.