code: def repartition(self, numPartitions):
          
          return self.transform(
              lambda rdd: (rdd.repartition(numPartitions)
                           if not isinstance(rdd, EmptyRDD) else rdd)
          )
docs: Repartition every RDD.
  
          :rtype: DStream
  
  
          Example:
  
          >>> import pysparkling
          >>> sc = pysparkling.Context()
          >>> ssc = pysparkling.streaming.StreamingContext(sc, 0.1)
          >>> (
          ...     ssc
          ...     .queueStream([['hello', 'world']])
          ...     .repartition(2)
          ...     .foreachRDD(lambda rdd: print(len(rdd.partitions())))
          ... )
          >>> ssc.start()
          >>> ssc.awaitTermination(0.25)
          2
          0