<commit_before>#!/usr/bin/env python
import os
import subprocess
import sys
from pathlib import Path

if __name__ == "__main__":
    os.chdir(Path(__file__).parent)
    os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py"
    os.environ.pop("PIP_REQUIRE_VIRTUALENV")
    common_args = ["-m", "piptools", "compile", "--generate-hashes"] + sys.argv[1:]
    subprocess.run(
        ["python3.6", *common_args, "-o", "py36.txt"],
        check=True,
    )
    subprocess.run(
        ["python3.7", *common_args, "-o", "py37.txt"],
        check=True,
    )
    subprocess.run(
        ["python3.8", *common_args, "-o", "py38.txt"],
        check=True,
    )
    subprocess.run(
        ["python3.9", *common_args, "-o", "py39.txt"],
        check=True,
    )
    subprocess.run(
        ["python3.10", *common_args, "-o", "py310.txt"],
        check=True,
    )
<commit_msg>Improve requirements/compile.py (#257)<commit_after>#!/usr/bin/env python
import os
import subprocess
import sys
from pathlib import Path

if __name__ == "__main__":
    os.chdir(Path(__file__).parent)
    os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py"
    os.environ.pop("PIP_REQUIRE_VIRTUALENV")
    common_args = [
        "-m",
        "piptools",
        "compile",
        "--generate-hashes",
        "--allow-unsafe",
    ] + sys.argv[1:]
    subprocess.run(
        ["python3.6", *common_args, "-o", "py36.txt"],
        check=True,
        capture_output=True,
    )
    subprocess.run(
        ["python3.7", *common_args, "-o", "py37.txt"],
        check=True,
        capture_output=True,
    )
    subprocess.run(
        ["python3.8", *common_args, "-o", "py38.txt"],
        check=True,
        capture_output=True,
    )
    subprocess.run(
        ["python3.9", *common_args, "-o", "py39.txt"],
        check=True,
        capture_output=True,
    )
    subprocess.run(
        ["python3.10", *common_args, "-o", "py310.txt"],
        check=True,
        capture_output=True,
    )

{'fraction_non_alphanumeric': 0.17408704352176088, 'fraction_numerical': 0.02451225612806403, 'mean_word_length': 2.4965034965034967, 'pattern_counts': {'":': 2, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1272083', 'n_tokens_mistral': 737, 'n_tokens_neox': 722, 'n_words': 118}