def download_file_repeatedly(tries, session, file_id, file_name, expected_file_size, request_headers, error):
    'Attempt to download BaseSpace file numerous times in case of errors.'
    for i in range(tries):
        try:
            download_file(session=session, file_id=file_id, file_name=file_name, request_headers=request_headers, error=error)
            raise_for_file_corruption(file_name=file_name, expected_file_size=expected_file_size, error=error)
            break
        except BaseSpaceDownloadError:
            if ((i + 1) == tries):
                error('Could not download file from BaseSpace.')
            else:
                time.sleep(3)
Attempt to download BaseSpace file numerous times in case of errors.
def download_file_repeatedly(tries, session, file_id, file_name, expected_file_size, request_headers, error):
    
    for i in range(tries):
        try:
            download_file(session=session, file_id=file_id, file_name=file_name, request_headers=request_headers, error=error)
            raise_for_file_corruption(file_name=file_name, expected_file_size=expected_file_size, error=error)
            break
        except BaseSpaceDownloadError:
            if ((i + 1) == tries):
                error('Could not download file from BaseSpace.')
            else:
                time.sleep(3)