def is_response_to_head(response):
 method = response._method
 if isinstance(method, int):
  return (method == 3)
 return (method.upper() == 'HEAD')

def is_response_to_head ( response ) : method = response . _method if isinstance ( method , int ) : return ( method == 3 ) return ( method . upper ( ) == 'HEAD' )
checks whether the request of a response has been a head-request .