def nations_from_str(nations, home, identifier):
    """Determine the nations of identified by ``qualifier``.

    Args:
        nations (set): Set of all possible nations.
        home (str): String denoting the home nations.
        identifier (str): String qualifying a country or a
            group of countries eg: ``Entrants``.

    Returns:
        Set of identified nations.

    Raises:
        ValueError if ``identifier`` does not represent
        recognized nations.
    """
    if identifier == 'Entrants':
        return nations
    if identifier == 'Foreigners':
        identified_nations = nations.copy()
        identified_nations.discard(home)
        return identified_nations

    if identifier not in nations:
        raise ValueError(f'{identifier} is not a recognized country')
    return {identifier}