code: def mapPartitionsWithIndex(self, f, preservesPartitioning=False):
          
          return self.transform(lambda rdd: rdd.mapPartitionsWithIndex(f, preservesPartitioning))
docs: Return a new DStream in which each RDD is generated by applying
          mapPartitionsWithIndex() to each RDDs of this DStream.