#NEWLINE# def process_response( self , request , response , spider ) : #NEWLINE# #INDENT# if isinstance ( response , Response ) : #NEWLINE# #INDENT# content_encoding = response . headers . getlist ( 'Content-Encoding' ) #NEWLINE# if ( content_encoding and ( not is_gzipped ( response ) ) ) : #NEWLINE# #INDENT# encoding = content_encoding . pop ( ) #NEWLINE# decoded_body = self . _decode ( response . body , encoding . lower ( ) ) #NEWLINE# respcls = responsetypes . from_args ( headers = response . headers , url = response . url ) #NEWLINE# kwargs = dict ( cls = respcls , body = decoded_body ) #NEWLINE# if issubclass ( self , TextResponse ) : #NEWLINE# #INDENT# kwargs [ 'encoding' ] = None #NEWLINE# #UNINDENT# response = response . replace ( ** kwargs ) #NEWLINE# if ( not content_encoding ) : #NEWLINE# #INDENT# del response . headers [ 'Content-Encoding' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return response