def exception_from_message(code, message, headers=None):
 kwargs = {'code': code, 'message': message, 'headers': headers}
 if (headers and ('retry_after' in headers)):
  kwargs['retry_after'] = headers['retry_after']
 cls = _code_map.get(code, BaseHTTPError)
 return cls(**kwargs)

def exception_from_message ( code , message , headers = None ) : kwargs = { 'code' : code , 'message' : message , 'headers' : headers } if ( headers and ( 'retry_after' in headers ) ) : kwargs [ 'retry_after' ] = headers [ 'retry_after' ] cls = _code_map . get ( code , BaseHTTPError ) return cls ( ** kwargs )
return an instance of basehttpexception or subclass based on response code .