parameters: (self)
docstring: Destructively rips this element out of the tree.
docstring_summary: Destructively rips this element out of the tree.
docstring_tokens: Destructively rips this element out of the tree .
function: def extract(self):
          """Destructively rips this element out of the tree."""        
          if self.parent:
              try:
                  self.parent.contents.remove(self)
              except ValueError:
                  pass
  
          #Find the two elements that would be next to each other if
          #this element (and any children) hadn't been parsed. Connect
          #the two.        
          lastChild = self._lastRecursiveChild()
          nextElement = lastChild.next
  
          if self.previous:
              self.previous.next = nextElement
          if nextElement:
              nextElement.previous = self.previous
          self.previous = None
          lastChild.next = None
  
          self.parent = None        
          if self.previousSibling:
              self.previousSibling.nextSibling = self.nextSibling
          if self.nextSibling:
              self.nextSibling.previousSibling = self.previousSibling
          self.previousSibling = self.nextSibling = None
function_tokens: def extract ( self ) : if self . parent : try : self . parent . contents . remove ( self ) except ValueError : pass #Find the two elements that would be next to each other if #this element (and any children) hadn't been parsed. Connect #the two.         lastChild = self . _lastRecursiveChild ( ) nextElement = lastChild . next if self . previous : self . previous . next = nextElement if nextElement : nextElement . previous = self . previous self . previous = None lastChild . next = None self . parent = None if self . previousSibling : self . previousSibling . nextSibling = self . nextSibling if self . nextSibling : self . nextSibling . previousSibling = self . previousSibling self . previousSibling = self . nextSibling = None