code: def reduce(self, func):
          
  
          # avoid RDD.reduce() which does not return an RDD
          return self.transform(
              lambda rdd: (
                  rdd
                  .map(lambda i: (None, i))
                  .reduceByKey(func)
                  .map(lambda none_i: none_i[1])
              )
          )
docs: Return a new DStream where each RDD was reduced with ``func``.
  
          :rtype: DStream