def stream(url, headers, stream_to=None, retry=True):
bot.debug("<STR_LIT>" %url)<EOL>if DISABLE_SSL_CHECK is True:<EOL><INDENT>bot.warning('<STR_LIT>')<EOL><DEDENT>response = requests.get(url,         <EOL>headers=headers,<EOL>verify=not DISABLE_SSL_CHECK,<EOL>stream=True)<EOL>if response.status_code == <NUM_LIT> and retry is True:<EOL><INDENT>headers = update_token(response, headers)<EOL>return stream(url, headers, stream_to, retry=False)<EOL><DEDENT>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>content_size = None<EOL>if '<STR_LIT>' in response.headers:<EOL><INDENT>progress = <NUM_LIT:0><EOL>content_size = int(response.headers['<STR_LIT>'])<EOL>bot.show_progress(progress,content_size,length=<NUM_LIT>)<EOL><DEDENT>chunk_size = <NUM_LIT:1> << <NUM_LIT:20><EOL>with open(stream_to,'<STR_LIT:wb>') as filey:<EOL><INDENT>for chunk in response.iter_content(chunk_size=chunk_size):<EOL><INDENT>filey.write(chunk)<EOL>if content_size is not None:<EOL><INDENT>progress+=chunk_size<EOL>bot.show_progress(iteration=progress,<EOL>total=content_size,<EOL>length=<NUM_LIT>,<EOL>carriage_return=False)<EOL><DEDENT><DEDENT><DEDENT>sys.stdout.write('<STR_LIT:\n>')<EOL>return stream_to <EOL><DEDENT>bot.error("<STR_LIT>" %(response.status_code))<EOL>sys.exit(<NUM_LIT:1>)<EOL>
stream is a get that will stream to file_name. Since this is a worker
       task, it differs from the client provided version in that it requires
       headers.