parameters: (self, root)
return_statement: return height(root) != -1
docstring: :type root: TreeNode
          :rtype: bool
docstring_summary: :type root: TreeNode
          :rtype: bool
docstring_tokens: : type root : TreeNode : rtype : bool
function: def isBalanced(self, root):
          """
          :type root: TreeNode
          :rtype: bool
          """
          def height(root):
              if not root:
                  return 0
  
              left = height(root.left)
              right = height(root.right)
              if left == -1 or right == -1 or abs(left - right) > 1:
                  return -1
  
              return max(left, right) + 1
          return height(root) != -1
function_tokens: def isBalanced ( self , root ) : def height ( root ) : if not root : return 0 left = height ( root . left ) right = height ( root . right ) if left == - 1 or right == - 1 or abs ( left - right ) > 1 : return - 1 return max ( left , right ) + 1 return height ( root ) != - 1