<commit_before>import os
import os.path
import shutil
import subprocess
import argparse
import re

parser = argparse.ArgumentParser(description='Runs the python 3 client doc generation script.')
parser.add_argument('game', action='store', help='the name of the game you want to document. Must exist in ../games/')

args = parser.parse_args()

game_name = args.game[0].upper() + args.game[1:]
lower_game_name = game_name[0].lower() + game_name[1:]

if os.path.isdir("./output"):
    shutil.rmtree("./output")

with open("_conf.json", "r") as template_conf:
    with open("conf.json", "w+") as temp_conf:
        temp_conf.write(template_conf.read().replace("###GAME_NAME###", game_name))


subprocess.call(["npm install"], shell=True)
subprocess.call(["jsdoc -t node_modules/jaguarjs-jsdoc -c conf.json -r ../README.md -d ./output ../games/{}/".format(lower_game_name)], shell=True)

# cleanup files we made
os.remove("conf.json")
shutil.rmtree("./node_modules")<commit_msg>Docs README default in GAME_NAME<commit_after>import os
import os.path
import shutil
import subprocess
import argparse
import re

parser = argparse.ArgumentParser(description='Runs the python 3 client doc generation script.')
parser.add_argument('game', action='store', help='the name of the game you want to document. Must exist in ../games/')

args = parser.parse_args()

game_name = args.game[0].upper() + args.game[1:]
lower_game_name = game_name[0].lower() + game_name[1:]

if os.path.isdir("./output"):
    shutil.rmtree("./output")

with open("_conf.json", "r") as template_conf:
    with open("conf.json", "w+") as temp_conf:
        temp_conf.write(template_conf.read().replace("###GAME_NAME###", game_name))

with open("../README.md", "r") as f:
    readme = f.read()

readme = readme.replace("GAME_NAME", game_name).replace("game_name", lower_game_name)

with open("README.md", "w+") as f:
    f.write(readme)


subprocess.call(["npm install"], shell=True)
subprocess.call(["jsdoc -t node_modules/jaguarjs-jsdoc -c conf.json -r README.md -d ./output ../games/{}/".format(lower_game_name)], shell=True)

# cleanup files we made
os.remove("conf.json")
os.remove("README.md")
shutil.rmtree("./node_modules")
{'fraction_non_alphanumeric': 0.17047531992687387, 'fraction_numerical': 0.004570383912248629, 'mean_word_length': 4.98087431693989, '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': '6775432', 'n_tokens_mistral': 769, 'n_tokens_neox': 749, 'n_words': 179}