def METHOD_NAME(format_string, attributes):
    try:
        return format_string.format(**attributes)
    except KeyError as e_key:
        logger.error("The IdP did not provide a required attribute: %s", e_key)
        abort(500)