code: def _check_node(self, obj):
          
          if not issubclass(type(obj), self.definition['node_class']):
              raise ValueError("Expected node of class " + self.definition['node_class'].__name__)
          if not hasattr(obj, 'id'):
              raise ValueError("Can't perform operation on unsaved node " + repr(obj))
docs: check for valid node i.e correct class and is saved