@lru_cache(maxsize=32)
def _inflate_currency(country: str=None, currency_year: int=None, to_year: int=None) -> float:
    '\n    Currency inflation for Pandas DataFrame column.\n    Helper function for `inflate_currency` method.\n    The API used is the World Bank Indicator API:\n    https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation\n    '
    check('country', country, [str])
    check('currency_year', currency_year, [int])
    check('to_year', to_year, [int])
    _check_wb_country(country)
    if (country in wb_country_dict.keys()):
        country = wb_country_dict[country]
    else:
        pass
    _check_wb_years(currency_year)
    _check_wb_years(to_year)
    url = (((((('https://api.worldbank.org/v2/country/' + country) + '/indicator/FP.CPI.TOTL?date=') + str(min(currency_year, to_year))) + ':') + str(max(currency_year, to_year))) + '&format=json')
    result = requests.get(url)
    if (result.status_code != 200):
        raise ConnectionError('WB Indicator API failed to receive a 200 response from the server. Please try again later.')
    inflation_dict = json.loads(result.text)[1]
    if (inflation_dict is None):
        raise ValueError('The WB Indicator API returned nothing. This likely means the currency_year and to_year are outside of the year range for which the WB has inflation data for the specified country.')
    inflation_dict_ready = {int(inflation_dict[i]['date']): float(inflation_dict[i]['value']) for i in range(len(inflation_dict)) if (inflation_dict[i]['value'] is not None)}
    if (currency_year not in inflation_dict_ready.keys()):
        raise ValueError(f'The WB Indicator API does not have inflation data for {currency_year} for {country}.')
    if (to_year not in inflation_dict_ready.keys()):
        raise ValueError(f'The WB Indicator API does not have inflation data for {to_year} for {country}.')
    inflator = (inflation_dict_ready[to_year] / inflation_dict_ready[currency_year])
    return inflator
Currency inflation for Pandas DataFrame column.
Helper function for `inflate_currency` method.
The API used is the World Bank Indicator API:
https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation
@lru_cache(maxsize=32)
def _inflate_currency(country: str=None, currency_year: int=None, to_year: int=None) -> float:
    '\n    Currency inflation for Pandas DataFrame column.\n    Helper function for `inflate_currency` method.\n    The API used is the World Bank Indicator API:\n    https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation\n    '
    check('country', country, [str])
    check('currency_year', currency_year, [int])
    check('to_year', to_year, [int])
    _check_wb_country(country)
    if (country in wb_country_dict.keys()):
        country = wb_country_dict[country]
    else:
        pass
    _check_wb_years(currency_year)
    _check_wb_years(to_year)
    url = (((((('https://api.worldbank.org/v2/country/' + country) + '/indicator/FP.CPI.TOTL?date=') + str(min(currency_year, to_year))) + ':') + str(max(currency_year, to_year))) + '&format=json')
    result = requests.get(url)
    if (result.status_code != 200):
        raise ConnectionError('WB Indicator API failed to receive a 200 response from the server. Please try again later.')
    inflation_dict = json.loads(result.text)[1]
    if (inflation_dict is None):
        raise ValueError('The WB Indicator API returned nothing. This likely means the currency_year and to_year are outside of the year range for which the WB has inflation data for the specified country.')
    inflation_dict_ready = {int(inflation_dict[i]['date']): float(inflation_dict[i]['value']) for i in range(len(inflation_dict)) if (inflation_dict[i]['value'] is not None)}
    if (currency_year not in inflation_dict_ready.keys()):
        raise ValueError(f'The WB Indicator API does not have inflation data for {currency_year} for {country}.')
    if (to_year not in inflation_dict_ready.keys()):
        raise ValueError(f'The WB Indicator API does not have inflation data for {to_year} for {country}.')
    inflator = (inflation_dict_ready[to_year] / inflation_dict_ready[currency_year])
    return inflator