<commit_before>#! /usr/bin/env python

import os, re, subprocess, time, json, ast

cwd = os.getcwd()
mainConfigFile = cwd + '/main.conf'
groupConfigFile = cwd + '/group.conf'

config = {}
groupConfig = {}

def is_number(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

def initConfig():
	global config
	config = {}
	config["userMediaPath"] = ""
	config["image_interval"] = 4
	config["image_blend_interval"] = 300
	config["video_enabled"] = 1
	config["image_enabled"] = 1
	config["autoplay"] = 1
	config["group_filetypes"] = 1
	config["shuffle"] = 0
	config["repeat"] = 1
	config["userPlaylist"] = ""
	return config

def initGroupConfig():
    global groupConfig
    groupConfig["group"] = None
    groupConfig["group_master"] = False
    groupConfig["group_master_name"] = None
    groupConfig["actions"] = []

def resetGroupConfig():
    initGroupConfig()
    writeGroupConfigFile()

def setConfigValue(key, value):
	global config
	if is_number(value):
		value = int(value)
	config[key] = value
	writeConfigFile()

def setGroupConfigValue(key, value):
    global groupConfig
    if is_number(value):
        value = int(value)
    groupConfig[key] = value<commit_msg>No initial config file in player project, when no file found initial config is created and written to new config file.<commit_after>#! /usr/bin/env python

import os, re, subprocess, time, json, ast

cwd = os.getcwd()
mainConfigFile = cwd + '/main.conf'
groupConfigFile = cwd + '/group.conf'

config = {}
groupConfig = {}

def is_number(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

def initConfig():
    global config
    if configFileAvailable:
        # config file available
        config = readConfig()
    else:
        # no config file available --> init
    	config = {}
    	config["userMediaPath"] = ""
    	config["image_interval"] = 4
    	config["image_blend_interval"] = 550
    	config["video_enabled"] = 0
    	config["image_enabled"] = 1
    	config["autoplay"] = 1
    	config["group_filetypes"] = 1
    	config["shuffle"] = 0
    	config["repeat"] = 1
    	config["userPlaylist"] = ""
        writeConfigFile()
	return config

def initGroupConfig():
    global groupConfig
    groupConfig["group"] = None
    groupConfig["group_master"] = False
    groupConfig["group_master_name"] = None
    groupConfig["actions"] = []

def resetGroupConfig():
    initGroupConfig()
    writeGroupConfigFile()

def setConfigValue(key, value):
	global config
	if is_number(value):
		value = int(value)
	config[key] = value
	writeConfigFile()

def setGroupConfigValue(key, value):
    global groupConfig
    if is_number(value):
        value = int(value)
    groupConfig[key] = value
{'fraction_non_alphanumeric': 0.12308812818645302, 'fraction_numerical': 0.007283321194464676, 'mean_word_length': 3.5106732348111658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5312455', 'n_tokens_mistral': 882, 'n_tokens_neox': 861, 'n_words': 219}