code: def reduceByKey(self, func, numPartitions=None):
          
          return self.transform(lambda rdd: rdd.reduceByKey(func))
docs: Apply reduceByKey to every RDD.
  
          :param func: reduce function to apply
          :param int numPartitions: number of partitions
          :rtype: DStream