input: 
  def isSubTree(T, S):
      """ Given two binary trees, check if the first tree is a subtree of the second tree.
      >>> isSubTree(Node(1), Node(1))
      True
      >>> isSubTree(Node(1), Node(2))
      False
      >>> isSubTree(Node(1, left=Node(2), right=Node(3)), Node(2))
      True
      >>> isSubTree(Node(1, left=Node(2), right=Node(3)), Node(1, left=Node(2)))
      False
      """
      if S is None:
          return True
      if T is None:
          return False
      if areIdentical(T, S):
          return True
      return isSubTree(T.left, S) or isSubTree(T.right, S)
  
  def areIdentical(T, S):
      if T is None and S is None:
          return True
      if T is None or S is None:
          return False
      return (T.data == S.data and areIdentical(T.left, S.left) and
              areIdentical(T.right, S.right))
  
output:     def isSubTree(T, S):
          """ Given two binary trees, check if the first tree is a subtree of the second tree.
          >>> isSubTree(Node(1), Node(1))
          True
          >>> isSubTree(Node(1), Node(2))
          False
          >>> isSubTree(Node(1, left=Node(2), right=Node(3)), Node(2))
          True
          >>> isSubTree(Node(1, left=Node(2), right=Node(3)), Node(1, left=Node(2)))
          False
          """
          if S is None:
              return True
          if T is None:
              return False
          if areIdentical(T, S):
              return True
          return isSubTree(T.left, S) or isSubTree(T.right, S)
  
      def areIdentical(T, S):
          if T is None and S is None:
              return True
          if T is None or S is None:
              return False
          return (T.data == S.data and areIdentical(T.left, S.left) and
                  areIdentical(T.right, S.right))