nodes: 0, module; 1, function_definition; 2, function_name:partition; 3, parameters; 4, block; 5, identifier:self; 6, identifier:mapped_values; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Organize the mapped values by their key.
          Returns an unsorted sequence of tuples with a key and a sequence of values.
          """; 12, assignment; 13, pattern_list; 14, identifier:mapped_values; 15, block; 16, call; 17, identifier:partitioned_data; 18, call; 19, identifier:key; 20, identifier:value; 21, expression_statement; 22, attribute; 23, argument_list; 24, attribute; 25, argument_list; 26, call; 27, identifier:partitioned_data; 28, identifier:items; 29, identifier:collections; 30, identifier:defaultdict; 31, identifier:list; 32, attribute; 33, argument_list; 34, subscript; 35, identifier:append; 36, identifier:value; 37, identifier:partitioned_data; 38, identifier:key
code: def partition(self, mapped_values):
          """Organize the mapped values by their key.
          Returns an unsorted sequence of tuples with a key and a sequence of values.
          """
          partitioned_data = collections.defaultdict(list)
          for key, value in mapped_values:
              partitioned_data[key].append(value)
          return partitioned_data.items()