def _raise_if_bad_http_status_and_method(response: AllHttpResponseType) -> None:
    """Check response status code is valid.

    Must be 200, 201, 202, or 204.

    :param response: The response object.
    :type response: any
    :raises: BadStatus if invalid status.
    """
    code = response.status_code
    if code in {200, 201, 202, 204}:
        return
    raise BadStatus("Invalid return status {!r} for {!r} operation".format(code, response.request.method))
Check response status code is valid.

    Must be 200, 201, 202, or 204.

    :param response: The response object.
    :type response: any
    :raises: BadStatus if invalid status.
    
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/core/polling/base_polling.py