def set_head(self, node):
    """Link this node to the current leaves."""
    for head in self.head:
      head.next.add(node)
    self.head[:] = []
    self.head.append(node)
def set_head ( self , node ) : for head in self . head : head . next . add ( node ) self . head [ : ] = [ ] self . head . append ( node )
Link this node to the current leaves.