def error_for(response):
 klass = error_classes.get(response.status_code)
 if (klass is None):
  if (400 <= response.status_code < 500):
   klass = ClientError
  if (500 <= response.status_code < 600):
   klass = ServerError
 return klass(response)

def error_for ( response ) : klass = error_classes . get ( response . status_code ) if ( klass is None ) : if ( 400 <= response . status_code < 500 ) : klass = ClientError if ( 500 <= response . status_code < 600 ) : klass = ServerError return klass ( response )
return the appropriate initialized exception class for a response .