Return the appropriate initialized exception class for a response.

def error_for(response):
    """Return the appropriate initialized exception class for a response."""
    klass = error_classes.get(response.status)
    if klass is None:
        if 400 <= response.status < 500:
            klass = ClientError
        if 500 <= response.status < 600:
            klass = ServerError  # pragma: no cover
    return klass(response)