:param fn: a key function

    :return:
        a function that wraps around the supplied key function to ensure
        the returned key is in uppercase.

def upper_key(fn):
    """
    :param fn: a key function

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