<commit_before>import pip
import pkg_resources


def ifninstall(pkg_name):
    """pip install language models used by spacy."""
    egg = '#egg='
    installed_pkg = [i.project_name for i in pkg_resources.working_set]
    egg_name = (egg in pkg_name) and pkg_name.split(egg)[1].replace('_', '-')
    if pkg_name and egg_name not in installed_pkg:
        pip.main(['install', pkg_name])<commit_msg>restore pip<commit_after>import pip


def ifninstall(pkg_name):
    """pip install language models used by spacy."""
    egg = '#egg='
    installed_pkg = [i.project_name for i in pip.get_installed_distributions()]
    egg_name = (egg in pkg_name) and pkg_name.split(egg)[1].replace('_', '-')
    if pkg_name and egg_name not in installed_pkg:
        pip.main(['install', pkg_name])
{'fraction_non_alphanumeric': 0.12804097311139565, 'fraction_numerical': 0.002560819462227913, 'mean_word_length': 4.144736842105263, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2095718', 'n_tokens_mistral': 271, 'n_tokens_neox': 250, 'n_words': 70}