<commit_before>import json
import os
import wiki

PROJECT_ROOT_DIRECTORY = os.path.dirname(globals()['__file__'])
DJANGO_WIKI_STATIC = os.path.join(os.path.dirname(wiki.__file__), 'static')

# This whole file is essentially just a big ugly hack.
# For webpack to properly build wiki static files it needs the absolute path to the wiki
# static folder. And since we're using virtualenvs there is no easy way to find this folder
# without running python code


def create_resolve_file():
    # Write to json file which will be read by webpack
    with open(os.path.join(PROJECT_ROOT_DIRECTORY, 'webpack-extra-resolve.json'), 'w') as f:
        f.write(json.dumps({
            'paths': [
                DJANGO_WIKI_STATIC
            ]
        }))


if __name__ == '__main__':
    # Only run if file is executed directly
    create_resolve_file()
<commit_msg>Remove unnecessary project root variable from webpack resolve script<commit_after>import json
import os
import wiki

DJANGO_WIKI_STATIC = os.path.join(os.path.dirname(wiki.__file__), 'static')
WEBPACK_RESOLVE_FILE = 'webpack-extra-resolve.json'

# This whole file is essentially just a big ugly hack.
# For webpack to properly build wiki static files it needs the absolute path to the wiki
# static folder. And since we're using virtualenvs there is no easy way to find this folder
# without running python code


def create_resolve_file():
    # Write to json file which will be read by webpack
    with open(WEBPACK_RESOLVE_FILE, 'w') as f:
        f.write(json.dumps({
            'paths': [
                DJANGO_WIKI_STATIC
            ]
        }))


if __name__ == '__main__':
    # Only run if file is executed directly
    create_resolve_file()

{'fraction_non_alphanumeric': 0.07880910683012259, 'fraction_numerical': 0.0, 'mean_word_length': 3.350253807106599, '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': '1025607', 'n_tokens_mistral': 520, 'n_tokens_neox': 501, 'n_words': 185}