code: def distinct(self, numPartitions=None):
          
          return self.map(lambda x: (x, None)) \
                     .reduceByKey(lambda x, _: x, numPartitions) \
                     .map(lambda x: x[0])
docs: Return a new RDD containing the distinct elements in this RDD.
  
          >>> sorted(sc.parallelize([1, 1, 2, 3]).distinct().collect())
          [1, 2, 3]