code: def tuplesorted(items, *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)
docs: 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.