nodes: 0, module; 1, function_definition; 2, function_name:distinct; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, return_statement; 9, identifier:numPartitions; 10, None; 11, comment:"""
          Return a new RDD containing the distinct elements in this RDD.
  
          >>> sorted(sc.parallelize([1, 1, 2, 3]).distinct().collect())
          [1, 2, 3]
          """; 12, call; 13, attribute; 14, argument_list; 15, call; 16, line_continuation:\; 17, identifier:map; 18, lambda; 19, attribute; 20, argument_list; 21, lambda_parameters; 22, subscript; 23, call; 24, line_continuation:\; 25, identifier:reduceByKey; 26, lambda; 27, identifier:numPartitions; 28, identifier:x; 29, identifier:x; 30, integer:0; 31, attribute; 32, argument_list; 33, lambda_parameters; 34, identifier:x; 35, identifier:self; 36, identifier:map; 37, lambda; 38, identifier:x; 39, identifier:_; 40, lambda_parameters; 41, tuple; 42, identifier:x; 43, identifier:x; 44, None
code: def distinct(self, numPartitions=None):
          """
          Return a new RDD containing the distinct elements in this RDD.
  
          >>> sorted(sc.parallelize([1, 1, 2, 3]).distinct().collect())
          [1, 2, 3]
          """
          return self.map(lambda x: (x, None)) \
                     .reduceByKey(lambda x, _: x, numPartitions) \
                     .map(lambda x: x[0])