input: from typing import Union
  
  class TreeNode:
      def __init__(self, value):
          self.value = value
          self.left = None
          self.right = None
  
  def dropLeafNodes(head: Union[TreeNode, None]) -> Union[TreeNode, None]: 
      """ Takes a Huffman tree and removes all leaf nodes.
      Given a Huffman tree like this:
            (1)
           /   \
        (2)     (3)
        / \    / \
      (4) (5) (6) (7)
      
      After this operation, the result will be:
            (1)
           /   \
        (2)     (3)
      where nodes (4), (5), (6), and (7) from the original tree will be dropped.
      
      Example:
      >>> root = TreeNode(1)
      >>> root.left = TreeNode(2)
      >>> root.right = TreeNode(3)
      >>> root.left.left = TreeNode(4)
      >>> root.left.right = TreeNode(5)
      >>> root.right.left = TreeNode(6)
      >>> root.right.right = TreeNode(7)
      >>> dropLeafNodes(root)
      Output: A tree with the same structure but with leaf nodes removed.
      """
      
      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
output:     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