def get_factor_key(type_id: int, specification_id: int, insert_id: int) -> int:
    """Retrieve the reference temperature key for the connection.

    :param type_id: the connection type identifier.
    :param specification_id: the connection governing specification
        identifier.
    :param insert_id: the insert material identifier.
    :return: _key; the key to use to select the reference temperature and other
        factors.
    :rtype: int
    """
    # Reference temperature is used to calculate base hazard rate for
    # circular/rack and panel connectors.  To get the reference temperature
    # dictionary key, we query the key dictionary in which the first key is
    # the connector type ID, second key is the specification ID.  The insert
    # material ID is the index in the list returned.
    _dic_keys = {
        1: {
            1: [2, 2, 2, 2, 2, 2],
            2: [2, 2, 2, 2, 2, 2],
            3: [1, 1, 1, 2, 2, 2, 2, 2, 2],
            4: [1, 1, 1, 2, 2, 2, 2, 2, 2],
            5: [1, 1, 1, 2, 2, 2, 2, 2, 2],
        },
        2: {
            1: [2, 2, 2, 2, 2, 2, 4, 4, 4],
            2: [1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 4],
            3: [1, 1, 1, 2, 2, 2, 2, 2, 2],
            4: [1, 1, 1, 2, 2, 2, 2, 2, 2],
            5: [2, 2, 2, 2, 2, 2],
            6: [2, 2, 2, 2, 2, 2],
        },
        3: {1: [2, 2, 2, 2, 2, 2, 4, 4, 4], 2: [2, 2, 2, 2, 2, 2, 4, 4, 4]},
        4: {
            1: [3, 3],
            2: [3, 3],
            3: [3, 3],
            4: [3, 3],
            5: [3, 3],
            6: [3, 3],
            7: [3, 3],
            8: [3, 3, 2, 2, 2, 2, 2, 2],
        },
        5: {1: [3, 3, 2, 2, 2, 2, 2, 2]},
    }
    return _dic_keys[type_id][specification_id][insert_id - 1]