import requests


def is_ok(resp):
    """
    Check a requests.models.response for a bad status code

    :param resp: response to check
    :return: True if the status_code is normal
    :rtype: boolean
    :raises HTTPError: if the status code is 5xx or 429
    """

    bad_status_codes = [429, 500, 501, 502, 503, 504, 505, 507, 508, 510, 511]
    if resp.status_code in bad_status_codes:
        msg = f'{resp.status_code} Error for url: {resp.url}'
        raise requests.exceptions.HTTPError(msg)
    return True