def reconcile_countries_by_name(plot_countries, gdp_countries):
    """
    Inputs:
      plot_countries - Dictionary whose keys are plot library country codes
                       and values are the corresponding country name
      gdp_countries  - Dictionary whose keys are country names used in GDP data

    Output:
      A tuple containing a dictionary and a set.  The dictionary maps
      country codes from plot_countries to country names from
      gdp_countries The set contains the country codes from
      plot_countries that were not found in gdp_countries.
    """
    code_country_dict = {}
    missing_code_set = set()
    for country_code, plot_country_name in plot_countries.items():
        if plot_country_name in gdp_countries:
            code_country_dict[country_code] = plot_country_name
        else:
            missing_code_set.add(country_code)
    return code_country_dict, missing_code_set