defdump_response_on_file(response,filepath=None):"""Useful when debugging responses. Calls to this method should not be committed."""ifnotfilepath:fromtempfileimportmkstemp_,filepath=mkstemp(text=True)f=file(filepath,'w')f.write(response.content)f.close()returnfilepathdefload_response_on_firefox(response):""" load html of a response for debugging purposes Attention: Calls to this method should not be committed. """importsubprocessfpath=dump_response_on_file(response)subprocess.call(['firefox',fpath])