input: plaintext
  def are_similar(root1: TreeNode, root2: TreeNode) -> bool:
      """ Compares two binary trees to check if they are similar. Two trees are considered 
      similar if they have the same structure and corresponding nodes have the same value.
      >>> from TreeNode import TreeNode
      >>> tree1 = TreeNode(5)
      >>> tree1.left = TreeNode(3)
      >>> tree1.right = TreeNode(8)
      >>> tree2 = TreeNode(5)
      >>> tree2.left = TreeNode(3)
      >>> tree2.right = TreeNode(8)
      >>> are_similar(tree1, tree2)
      True
      >>> tree3 = TreeNode(5)
      >>> tree3.left = TreeNode(4)
      >>> tree3.right = TreeNode(8)
      >>> are_similar(tree1, tree3)
      False
      """
      if root1 is None and root2 is None:
          return True
      if (root1 and root2) is None or (root1 or root2) is None:
          return False
      if root1.val != root2.val:
          return False
      else:
          return are_similar(root1.left, root2.left) and are_similar(root1.right, root2.right)
  
output:     if root1 is None and root2 is None:
          return True
      if root1 is None or root2 is None:
          return False
      if root1.val != root2.val:
          return False
      return are_similar(root1.left, root2.left) and are_similar(root1.right, root2.right)