parameters: (self, root)
return_statement: return self.record[root]
docstring: :type root: TreeNode
          :rtype: int
docstring_summary: :type root: TreeNode
          :rtype: int
docstring_tokens: : type root : TreeNode : rtype : int
function: def rob(self, root):
          """
          :type root: TreeNode
          :rtype: int
          """
          if not root: return 0
          if root in self.record: return self.record[root]
                  
          plan1 = self.rob(root.left)+self.rob(root.right)        
          plan2 = root.val
          if root.left:
              plan2+= self.rob(root.left.left)+self.rob(root.left.right)
          if root.right:
              plan2+= self.rob(root.right.left)+self.rob(root.right.right)
              
          self.record[root]=max(plan1,plan2)
          return self.record[root]
function_tokens: def rob ( self , root ) : if not root : return 0 if root in self . record : return self . record [ root ] plan1 = self . rob ( root . left ) + self . rob ( root . right ) plan2 = root . val if root . left : plan2 += self . rob ( root . left . left ) + self . rob ( root . left . right ) if root . right : plan2 += self . rob ( root . right . left ) + self . rob ( root . right . right ) self . record [ root ] = max ( plan1 , plan2 ) return self . record [ root ]