def METHOD_NAME(
    cls, interaction_id: Optional[str]
) -> base.BaseInteraction:
    """Gets an interaction by its id.
    Refreshes once if the interaction is not found; subsequently, throws a
    KeyError.
    Args:
        interaction_id: Optional[str]. The interaction id.
    Returns:
        BaseInteraction. An interaction for the given interaction_id.
    Raises:
        Exception. No interaction exists for the None interaction_id.
    """
    if interaction_id is None:
        raise Exception(
            'No interaction exists for the None interaction_id.'
        )
    if interaction_id not in cls._interactions:
        cls._refresh()
    return cls._interactions[interaction_id]