from typing import Union


def alfa_key(alfa: Union[str, int]) -> Union[str, None]:
    """
    Return the numeric value of a possible alfanumeric key name. See "alfanumeric key names".

    Parameters
    ----------
    alfa : str | int
        The package name from "alfa numeric names" list
        or the correspondent index

    Returns
    -------
    alfa_code : str
        The correspondent alfa numeric code

    Raises
    ------
    TypeError
        If `alfa` type isn't str or int
    
    Examples
    --------
    >>> alfa_key('A')
    29
    >>> alfa_key(10)
    29
    """
    alfa_key_list = [
        ['0', 7],
        ['1', 8],
        ['2', 9],
        ['3', 10],
        ['4', 11],
        ['5', 12],
        ['6', 13],
        ['7', 14],
        ['8', 15],
        ['9', 16],
        ['A', 29],
        ['B', 30],
        ['C', 31],
        ['D', 32],
        ['E', 33],
        ['F', 34],
        ['G', 35],
        ['H', 36],
        ['I', 37],
        ['J', 38],
        ['K', 39],
        ['L', 40],
        ['M', 41],
        ['N', 42],
        ['O', 43],
        ['P', 44],
        ['Q', 45],
        ['R', 46],
        ['S', 47],
        ['T', 48],
        ['U', 49],
        ['V', 50],
        ['W', 51],
        ['X', 52],
        ['Y', 53],
        ['Z', 54]]
    if type(alfa) == int:
        return(alfa_key_list[int(alfa)][1])
    elif type(alfa) == str:
        for index in range(len(alfa_key_list)):
            if str(alfa_key_list[index][0]) == alfa:
                alfa_code = alfa_key_list[index][1]
                return(alfa_code)
    else:
        raise TypeError()