<commit_before>import os, json, shutil, ConfigParser, sys, requests

requiredfolders = ["data", "data/db", "data/cache"]

base = os.getcwd()

datafile = os.path.join(base, "data", "db.json")
configfile = os.path.join(base, "data", "config.ini")
cachedir = os.path.join(base, "data", "cache")

def checkupdate():
    f = open("version.txt")
    currentversion = f.read()
    f.close()

    versionurl = "https://raw.githubusercontent.com/SuPeRMiNoR2/ssdeploy/master/version.txt"
    r = requests.get(versionurl)
    if not currentversion == r.content:
        print("New version availible! Please run git pull")

def checkstructure():
    for i in requiredfolders:
        if not os.path.exists(i):
            print("Making folder: {0}".format(i))
            os.mkdir(i)

    if os.path.exists(cachedir):
        print("Cleaning cache dir")
        shutil.rmtree(cachedir)
    os.mkdir(cachedir)

def loadconfig():
    if not os.path.exists(configfile):
        print("Creating default config file.")
        Config = ConfigParser.ConfigParser()
        f = open(configfile, "w")
        Config.add_section("locations")
        Config.set("locations", "servermoddir", "replaceme")<commit_msg>Make that stand out.<commit_after>import os, json, shutil, ConfigParser, sys, requests

requiredfolders = ["data", "data/db", "data/cache"]

base = os.getcwd()

datafile = os.path.join(base, "data", "db.json")
configfile = os.path.join(base, "data", "config.ini")
cachedir = os.path.join(base, "data", "cache")

def checkupdate():
    f = open("version.txt")
    currentversion = f.read()
    f.close()

    versionurl = "https://raw.githubusercontent.com/SuPeRMiNoR2/ssdeploy/master/version.txt"
    r = requests.get(versionurl)
    if not currentversion == r.content:
        print("-----------------------------------------------")
        print("ssdeploy update availible! Please run git pull")
        print("-----------------------------------------------")

def checkstructure():
    for i in requiredfolders:
        if not os.path.exists(i):
            print("Making folder: {0}".format(i))
            os.mkdir(i)

    if os.path.exists(cachedir):
        print("Cleaning cache dir")
        shutil.rmtree(cachedir)
    os.mkdir(cachedir)

def loadconfig():
    if not os.path.exists(configfile):
        print("Creating default config file.")
        Config = ConfigParser.ConfigParser()
        f = open(configfile, "w")
        Config.add_section("locations")
        Config.set("locations", "servermoddir", "replaceme")
{'fraction_non_alphanumeric': 0.18163830629204591, 'fraction_numerical': 0.0015829046299960427, 'mean_word_length': 2.745185185185185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4387938', 'n_tokens_mistral': 794, 'n_tokens_neox': 774, 'n_words': 174}