<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_class_for_http_status(status):
 """Return the appropriate `ResponseError` subclass for the given HTTP status code."""

    try:
        return error_classes[status]
    except KeyError:
        def new_status_error(xml_response):
            if (status > 400 and status < 500):
                return UnexpectedClientError(status, xml_response)
            if (status > 500 and status < 600):
                return UnexpectedServerError(status, xml_response)
            return UnexpectedStatusError(status, xml_response)
        return new_status_error