<commit_before>import os
import subprocess


def download_file(url, dest):
    ensure_dir(os.path.dirname(dest))
    return subprocess.call(['wget', url, '-O', dest, '--quiet']) == 0


def unzip_file(filename, dest):
    ensure_dir(dest)
    subprocess.call(['unzip', '-o', filename, '-d', dest])


def remove_file(filename):
    os.unlink(filename)


def ensure_dir(d):
    if not os.path.exists(d):<commit_msg>[utils] Using curl with redirects and retries for download_file<commit_after>import os
import subprocess
import six


def download_file(url, dest, retries=3, retry_delay=5):
    ensure_dir(os.path.dirname(dest))
    return subprocess.call(['curl', url, '-L', '--retry', six.text_type(retries),
                            '--retry-delay', six.text_type(retry_delay),
                            '-o', dest, '--silent']) == 0


def unzip_file(filename, dest):
    ensure_dir(dest)
    subprocess.call(['unzip', '-o', filename, '-d', dest])


def remove_file(filename):
    os.unlink(filename)


def ensure_dir(d):
    if not os.path.exists(d):
{'fraction_non_alphanumeric': 0.1603415559772296, 'fraction_numerical': 0.003795066413662239, 'mean_word_length': 3.5085470085470085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7461049', 'n_tokens_mistral': 363, 'n_tokens_neox': 352, 'n_words': 80}