nodes: 0, module; 1, function_definition; 2, function_name:map; 3, parameters; 4, block; 5, identifier:self; 6, identifier:f; 7, default_parameter; 8, expression_statement; 9, function_definition; 10, return_statement; 11, identifier:preservesPartitioning; 12, False; 13, comment:"""
          Return a new RDD by applying a function to each element of this RDD.
  
          >>> rdd = sc.parallelize(["b", "a", "c"])
          >>> sorted(rdd.map(lambda x: (x, 1)).collect())
          [('a', 1), ('b', 1), ('c', 1)]
          """; 14, function_name:func; 15, parameters; 16, block; 17, call; 18, identifier:_; 19, identifier:iterator; 20, return_statement; 21, attribute; 22, argument_list; 23, call; 24, identifier:self; 25, identifier:mapPartitionsWithIndex; 26, identifier:func; 27, identifier:preservesPartitioning; 28, identifier:map; 29, argument_list; 30, call; 31, identifier:iterator; 32, identifier:fail_on_stopiteration; 33, argument_list; 34, identifier:f
code: def map(self, f, preservesPartitioning=False):
          """
          Return a new RDD by applying a function to each element of this RDD.
  
          >>> rdd = sc.parallelize(["b", "a", "c"])
          >>> sorted(rdd.map(lambda x: (x, 1)).collect())
          [('a', 1), ('b', 1), ('c', 1)]
          """
          def func(_, iterator):
              return map(fail_on_stopiteration(f), iterator)
          return self.mapPartitionsWithIndex(func, preservesPartitioning)