code: def map(self, f, preservesPartitioning=False):
          
          def func(iterator):
              return map(f, iterator)
          return self.mapPartitions(func, preservesPartitioning)
docs: Return a new DStream by applying a function to each element of DStream.