code: def groupByKey(self, numPartitions=None):
          
          if numPartitions is None:
              numPartitions = self._sc.defaultParallelism
          return self.transform(lambda rdd: rdd.groupByKey(numPartitions))
docs: Return a new DStream by applying groupByKey on each RDD.