def _dump_response(http_response):
 output = ('HttpResponse\n  status: %s\n  reason: %s\n  headers:' % (http_response.status, http_response.reason))
 headers = get_headers(http_response)
 if isinstance(headers, dict):
  for (header, value) in headers.iteritems():
   output += ('    %s: %s\n' % (header, value))
 else:
  for pair in headers:
   output += ('    %s: %s\n' % (pair[0], pair[1]))
 return output

def _dump_response ( http_response ) : output = ( 'HttpResponse\n  status: %s\n  reason: %s\n  headers:' % ( http_response . status , http_response . reason ) ) headers = get_headers ( http_response ) if isinstance ( headers , dict ) : for ( header , value ) in headers . iteritems ( ) : output += ( '    %s: %s\n' % ( header , value ) ) else : for pair in headers : output += ( '    %s: %s\n' % ( pair [ 0 ] , pair [ 1 ] ) ) return output
converts to a string for printing debug messages .