code: def remove(self):
          
          if self.parent is not None:
              for i, child in enumerate(self.parent.children):
                  if id(child) == id(self):
                      self.parent.remove_child(i)
                      self.parent = None
                      break
docs: Remove this node from the list of children of its current parent,
          if the current parent is not ``None``, otherwise do nothing.
  
          .. versionadded:: 1.7.0