<commit_before>
from enum import Enum

class SleepState(Enum):
	asleep = 1
	waking = 2 # going from asleep to awake
	awake =  3
	falling_asleep = 4 # going from awake to asleep

import datetime

DateTimeFormat = "%Y-%m-%dT%H:%M"

def time_str_from_tuple(t):
	return str(t[0]) + ":" + str(t[1])

def str_from_datetime(o):
	return o.strftime(DateTimeFormat);<commit_msg>adding config stuff<commit_after>
from enum import Enum

class SleepState(Enum):
	asleep = 1
	waking = 2 # going from asleep to awake
	awake =  3
	falling_asleep = 4 # going from awake to asleep

ZzzCronConfigDir = "~/.zzzcron.d/"
ZzzCronSleepLog = ZzzCronConfigDir + "sleep.log"

import configparser

def load_config():
	config = configparser.ConfigParser()
	config.read( ZzzCronConfigDir + "config.ini" )
	return config

def save_config(config):

	if type(config) is not configparser.ConfigParser:
		raise TypeError("save_config expects configparser.ConfigParser")

	with open(ZzzCronConfigDir + "config.ini") as confFile:
		config.write(confFile)
	

import datetime

DateTimeFormat = "%Y-%m-%dT%H:%M"

def time_str_from_tuple(t):
	return str(t[0]) + ":" + str(t[1])

def str_from_datetime(o):
	return o.strftime(DateTimeFormat);
{'fraction_non_alphanumeric': 0.11759799833194329, 'fraction_numerical': 0.010008340283569641, 'mean_word_length': 5.122448979591836, 'pattern_counts': {'":': 2, '<': 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': '4052305', 'n_tokens_mistral': 444, 'n_tokens_neox': 426, 'n_words': 110}