<commit_before>"""Download dev data from github.com:hypothesis/devdata.git."""

import os
from pathlib import Path
from shutil import copyfile
from subprocess import check_call
from tempfile import TemporaryDirectory


def _get_devdata():
    # The directory that we'll clone the devdata git repo into.
    with TemporaryDirectory() as tmp_dir_name:
        git_dir = os.path.join(tmp_dir_name, "devdata")

        check_call(["git", "clone", "<EMAIL>:hypothesis/devdata.git", git_dir])

        # Copy devdata files into place.
        for source, target in (
            ("via/devdata.env", ".devdata.env"),
            (
                "via/devdata/google_drive_credentials.json",
                ".devdata/google_drive_credentials.json",
            ),
            (
                "via/devdata/google_drive_resource_keys.json",
                ".devdata/google_drive_resource_keys.json",
            ),
        ):
            print(f"Creating {target}...")
            copyfile(
                os.path.join(git_dir, source),
                os.path.join(Path(__file__).parent.parent, target),
            )


if __name__ == "__main__":
    _get_devdata()
<commit_msg>Change to HTTPS for the devdata clone URL<commit_after>"""Download dev data from github.com:hypothesis/devdata.git."""

import os
from pathlib import Path
from shutil import copyfile
from subprocess import check_call
from tempfile import TemporaryDirectory


def _get_devdata():
    # The directory that we'll clone the devdata git repo into.
    with TemporaryDirectory() as tmp_dir_name:
        git_dir = os.path.join(tmp_dir_name, "devdata")

        check_call(
            ["git", "clone", "https://github.com/hypothesis/devdata.git", git_dir]
        )

        # Copy devdata files into place.
        for source, target in (
            ("via/devdata.env", ".devdata.env"),
            (
                "via/devdata/google_drive_credentials.json",
                ".devdata/google_drive_credentials.json",
            ),
            (
                "via/devdata/google_drive_resource_keys.json",
                ".devdata/google_drive_resource_keys.json",
            ),
        ):
            print(f"Creating {target}...")
            copyfile(
                os.path.join(git_dir, source),
                os.path.join(Path(__file__).parent.parent, target),
            )


if __name__ == "__main__":
    _get_devdata()

{'fraction_non_alphanumeric': 0.10949813355454169, 'fraction_numerical': 0.0, 'mean_word_length': 2.1243523316062176, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6017617', 'n_tokens_mistral': 722, 'n_tokens_neox': 693, 'n_words': 152}