code: def link_head(self, node):
          '''Add a node to the head. '''
          assert not node.tail
          old_head = self.head
  
          if old_head:
              assert old_head.tail == self
              old_head.tail = node
              node.head = old_head
  
          node.tail = self
          self.head = nodf link_head(self, node):
          '''Add a node to the head. '''
          assert not node.tail
          old_head = self.head
  
          if old_head:
              assert old_head.tail == self
              old_head.tail = node
              node.head = old_head
  
          node.tail = self
          self.head = node
docs: Add a node to the head.