session = requests_retry_session()
response = session.get(url, stream=True)
if response.status_code == codes[u"OK"]:
with open(file_name, u"wb") as file_handle:
file_handle.write(response.raw.read())
else:
session = requests_retry_session()
response = session.get(url, stream=True)
if response.status_code == codes[u"OK"]:
with open(file_name, u"wb") as file_handle:
file_handle.write(response.raw.read())
else: