nodes: 0, module; 1, function_definition; 2, function_name:tuplesorted; 3, parameters; 4, block; 5, identifier:items; 6, list_splat_pattern; 7, expression_statement; 8, comment:# Transform the keys so each works on one item of the tuple; 9, expression_statement; 10, return_statement; 11, identifier:keys; 12, comment:"""Sort by tuples with a different key for each item.
  
      Args:
          items: An iterable series of sequences (typically tuples)
  
          *keys: Key objects which transform individual elements of
             each tuple into sort keys. The zeroth object
             transforms the zeroth element of each tuple, the first
             key object transforms the first element of each tuple,
             and so on.
      Returns:
          A list of items sorted according to keys.
      """; 13, assignment; 14, call; 15, identifier:tuple_keys; 16, list_comprehension; 17, identifier:multisorted; 18, argument_list; 19, call; 20, for_in_clause; 21, identifier:items; 22, list_splat; 23, identifier:Key; 24, argument_list; 25, pattern_list; 26, call; 27, identifier:tuple_keys; 28, keyword_argument; 29, keyword_argument; 30, identifier:index; 31, identifier:key; 32, identifier:enumerate; 33, argument_list; 34, identifier:func; 35, lambda; 36, identifier:reverse; 37, attribute; 38, identifier:keys; 39, lambda_parameters; 40, call; 41, identifier:key; 42, identifier:reverse; 43, identifier:t; 44, default_parameter; 45, default_parameter; 46, attribute; 47, argument_list; 48, identifier:i; 49, identifier:index; 50, identifier:k; 51, identifier:key; 52, identifier:k; 53, identifier:func; 54, subscript; 55, identifier:t; 56, identifier:i
code: def tuplesorted(items, *keys):
      """Sort by tuples with a different key for each item.
  
      Args:
          items: An iterable series of sequences (typically tuples)
  
          *keys: Key objects which transform individual elements of
             each tuple into sort keys. The zeroth object
             transforms the zeroth element of each tuple, the first
             key object transforms the first element of each tuple,
             and so on.
      Returns:
          A list of items sorted according to keys.
      """
      # Transform the keys so each works on one item of the tuple
      tuple_keys = [
          Key(func=lambda t, i=index, k=key: k.func(t[i]), reverse=key.reverse)
          for index, key in enumerate(keys)
      ]
      return multisorted(items, *tuple_keys)