input: Write a function to drop all leaf nodes from a given Huffman tree.
  
  def dropLeafNodes(head): 
      # If node is not None and doesn't have any children 
      if head and not head.left and not head.right: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
    
      # Return head of the modified tree
      return head
  
  assert dropLeafNodes(None) == None
  assert dropLeafNodes(Tree({'val': 1, 'left': Tree({'val': 2, 'left': Tree({'val': 4}), 'right': Tree({'val': 5})}), 'right': Tree({'val': 3, 'left': Tree({'val': 6}), 'right': Tree({'val': 7})})})) == Tree({'val': 1, 'left': Tree({'val': 2, 'left': None, 'right': None}), 'right': Tree({'val': 3, 'left': None, 'right': None})})
output: def dropLeafNodes(head): 
      if head and not head.left and not head.right: 
          return None
      if not head: 
          return None
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
      return head