will return the rate for the currency today or for given date
    valid_days_max is used only if service fails and this method try find something in cache
        dates from cache will be used in range <date - valid_days_max; date + valid_days_max>
        if valid_days_max is None (default), VALID_DAYS_MAX_DEFAULT is used instead

def rate(currency, date=None, valid_days_max=None):
    """will return the rate for the currency today or for given date
    valid_days_max is used only if service fails and this method try find something in cache
        dates from cache will be used in range <date - valid_days_max; date + valid_days_max>
        if valid_days_max is None (default), VALID_DAYS_MAX_DEFAULT is used instead
    """
    result = _rate(currency, date, valid_days_max=valid_days_max)
    return apply_amount(result[0], result[1])