code: def upper_key(fn):
      
      def upper(key):
          try:
              return key.upper()
          except AttributeError:
              return key
      return process_key(upper, fn)
docs: :param fn: a key function
  
      :return:
          a function that wraps around the supplied key function to ensure
          the returned key is in uppercase.