nodes: 0, module; 1, function_definition; 2, function_name:groupBy; 3, parameters; 4, block; 5, identifier:self; 6, identifier:f; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, return_statement; 11, identifier:numPartitions; 12, None; 13, identifier:partitionFunc; 14, identifier:portable_hash; 15, comment:"""
          Return an RDD of grouped items.
  
          >>> rdd = sc.parallelize([1, 1, 2, 3, 5, 8])
          >>> result = rdd.groupBy(lambda x: x % 2).collect()
          >>> sorted([(x, sorted(y)) for (x, y) in result])
          [(0, [2, 8]), (1, [1, 1, 3, 5])]
          """; 16, call; 17, attribute; 18, argument_list; 19, call; 20, identifier:groupByKey; 21, identifier:numPartitions; 22, identifier:partitionFunc; 23, attribute; 24, argument_list; 25, identifier:self; 26, identifier:map; 27, lambda; 28, lambda_parameters; 29, tuple; 30, identifier:x; 31, call; 32, identifier:x; 33, identifier:f; 34, argument_list; 35, identifier:x
code: def groupBy(self, f, numPartitions=None, partitionFunc=portable_hash):
          """
          Return an RDD of grouped items.
  
          >>> rdd = sc.parallelize([1, 1, 2, 3, 5, 8])
          >>> result = rdd.groupBy(lambda x: x % 2).collect()
          >>> sorted([(x, sorted(y)) for (x, y) in result])
          [(0, [2, 8]), (1, [1, 1, 3, 5])]
          """
          return self.map(lambda x: (f(x), x)).groupByKey(numPartitions, partitionFunc)