def get_response_stream(response):
 try:
  getheader = response.headers.getheader
 except AttributeError:
  getheader = response.getheader
 if (getheader('content-encoding') == 'gzip'):
  return GzipDecodedResponse(response)
 return response

def get_response_stream ( response ) : try : getheader = response . headers . getheader except AttributeError : getheader = response . getheader if ( getheader ( 'content-encoding' ) == 'gzip' ) : return GzipDecodedResponse ( response ) return response
helper function to return either a gzip reader if content-encoding is gzip otherwise the response itself .