nodes: 0, module; 1, function_definition; 2, function_name:lookup; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""
          Return the list of values in the RDD for key `key`. This operation
          is done efficiently if the RDD has a known partitioner by only
          searching the partition that the key maps to.
  
          >>> l = range(1000)
          >>> rdd = sc.parallelize(zip(l, l), 10)
          >>> rdd.lookup(42)  # slow
          [42]
          >>> sorted = rdd.sortByKey()
          >>> sorted.lookup(42)  # fast
          [42]
          >>> sorted.lookup(1024)
          []
          >>> rdd2 = sc.parallelize([(('a', 'b'), 'c')]).groupByKey()
          >>> list(rdd2.lookup(('a', 'b'))[0])
          ['c']
          """; 12, assignment; 13, comparison_operator:self.partitioner is not None; 14, block; 15, call; 16, identifier:values; 17, call; 18, attribute; 19, None; 20, return_statement; 21, attribute; 22, argument_list; 23, attribute; 24, argument_list; 25, identifier:self; 26, identifier:partitioner; 27, call; 28, identifier:values; 29, identifier:collect; 30, call; 31, identifier:values; 32, attribute; 33, argument_list; 34, attribute; 35, argument_list; 36, attribute; 37, identifier:runJob; 38, identifier:values; 39, lambda; 40, list; 41, identifier:self; 42, identifier:filter; 43, lambda; 44, identifier:self; 45, identifier:ctx; 46, lambda_parameters; 47, identifier:x; 48, call; 49, lambda_parameters; 50, comparison_operator:kv[0] == key; 51, identifier:x; 52, attribute; 53, argument_list; 54, identifier:kv; 55, subscript; 56, identifier:key; 57, identifier:self; 58, identifier:partitioner; 59, identifier:key; 60, identifier:kv; 61, integer:0
code: def lookup(self, key):
          """
          Return the list of values in the RDD for key `key`. This operation
          is done efficiently if the RDD has a known partitioner by only
          searching the partition that the key maps to.
  
          >>> l = range(1000)
          >>> rdd = sc.parallelize(zip(l, l), 10)
          >>> rdd.lookup(42)  # slow
          [42]
          >>> sorted = rdd.sortByKey()
          >>> sorted.lookup(42)  # fast
          [42]
          >>> sorted.lookup(1024)
          []
          >>> rdd2 = sc.parallelize([(('a', 'b'), 'c')]).groupByKey()
          >>> list(rdd2.lookup(('a', 'b'))[0])
          ['c']
          """
          values = self.filter(lambda kv: kv[0] == key).values()
  
          if self.partitioner is not None:
              return self.ctx.runJob(values, lambda x: x, [self.partitioner(key)])
  
          return values.collect()