def custom_response_text_rewriter(raw_text, content_mime, remote_url):
 raw_text = regex_ubb_img_rewriter.sub('<img src="\\g<image_url>" style="max-width: 100%;"></img>', raw_text)
 regex_twitter_data_expanded.sub(demo__handle_expand_url, raw_text)
 if (('search' in remote_url) and ((content_mime == 'text/html') or (content_mime == 'application/json'))):
  raw_text = demo__google_result_open_in_new_tab(raw_text, content_mime)
 raw_text = raw_text.replace('www.google-analytics.com/analytics.js', '')
 if (content_mime == 'text/html'):
  my_statistic_code = '<!--Your Own Statistic Code-->'
  raw_text = raw_text.replace('</head>', (my_statistic_code + '</head>'), 1)
 return raw_text

def custom_response_text_rewriter ( raw_text , content_mime , remote_url ) : raw_text = regex_ubb_img_rewriter . sub ( '<img src="\\g<image_url>" style="max-width: 100%;"></img>' , raw_text ) regex_twitter_data_expanded . sub ( demo__handle_expand_url , raw_text ) if ( ( 'search' in remote_url ) and ( ( content_mime == 'text/html' ) or ( content_mime == 'application/json' ) ) ) : raw_text = demo__google_result_open_in_new_tab ( raw_text , content_mime ) raw_text = raw_text . replace ( 'www.google-analytics.com/analytics.js' , '' ) if ( content_mime == 'text/html' ) : my_statistic_code = '<!--Your Own Statistic Code-->' raw_text = raw_text . replace ( '</head>' , ( my_statistic_code + '</head>' ) , 1 ) return raw_text
allow you do some custom modifications/rewrites to the response content .