comefrom: <garvit244>102_1.py
code: def levelOrder( root):
      if not root:
          return []
      
      queue = [(root, 0)]
      levelMap = {}
      
      while queue:
          node, level = queue.pop(0)
          if node.left:
              queue.append((node.left, level+1))
          if node.right:
              queue.append((node.right, level+1))
      
          if level in levelMap:
              levelMap[level].append(node.val)
          else:
              levelMap[level] = [node.val]
      
      result = []
      for key, value in levelMap.iteritems():
          result.append(value)
      return result
masked: def sample_funcname ( var_0 ) :
      if not var_0 :
          return [ ]
      var_1 = [ ( var_0 , 0 ) ]
      var_2 = { }
      while var_1 :
          var_3 , var_4 = var_1.pop ( 0 )
          if var_3.left :
              var_1.append ( ( var_3.left , var_4 + 1 ) )
          if var_3.right :
              var_1.append ( ( var_3.right , var_4 + 1 ) )
          if var_4 in var_2 :
              var_2 [ var_4 ].append ( var_3.val )
          else :
              var_2 [ var_4 ] = [ var_3.val ]
      var_5 = [ ]
      for var_6 , var_7 in var_2.iteritems ( ) :
          var_5.append ( var_7 )
      return var_5
  