<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)