parameters: (self, old, new)
docstring: Replace one child `Node` with another child or children.
docstring_summary: Replace one child `Node` with another child or children.
docstring_tokens: Replace one child Node with another child or children .
function: def replace(self, old, new):
          """Replace one child `Node` with another child or children."""
          index = self.index(old)
          if isinstance(new, Node):
              self.setup_child(new)
              self[index] = new
          elif new is not None:
              self[index:index+1] = new
function_tokens: def replace ( self , old , new ) : index = self . index ( old ) if isinstance ( new , Node ) : self . setup_child ( new ) self [ index ] = new elif new is not None : self [ index : index + 1 ] = new