<commit_before>import time
import os,sys

ServiceCodes = {
    'STARTED':101,
    'CALLRECV':102,
    'RUNNING':103,
    'DB_ERROR':104,
    'UNKNOWN':105,
    'COMPLETED':106,
    'DB_SUCCESS':107,
    'DB_NOID_FOUND':108,
    'DB_CONNECT_SUCCESS':109,
    'DB_CONNECT_FAILED':110,
    'DUPLICATE_ID':111,
    'DB_POP_FAILED':112,
    'DB_POP_ZERO':113,
    'DB_QUERY_FAILED':114,
    'GAIA_FILE_CREATION_FAILED':115,
    'GAIA_FILE_CREATION_COMPLETE':116,
    'CALLING_GAIA':117,
    'GAIA_FAILED':118,
    'GAIA_SUCCESS':119,
    'FILE_MOVE_FAILED':120
    }

ServiceDescriptions = {
    ServiceCodes['STARTED']:'Started Logging',
    ServiceCodes['CALLRECV']:'Incoming Call recieved',
    ServiceCodes['RUNNING']:'The service is Running',
    ServiceCodes['DB_ERROR']:'There has been an error in working accessing the ApolloDB',
    ServiceCodes['UNKNOWN']:'Unknown Status Code',
    ServiceCodes['COMPLETED']:'Completed creating visualizaton',
    ServiceCodes['DB_SUCCESS']:'Successfully obtained data from the ApolloDB',
    ServiceCodes['DB_NOID_FOUND']:'No ID found in ApolloDB',
    ServiceCodes['DB_CONNECT_SUCCESS']:'Successfully connected to the ApolloDB',
    ServiceCodes['DB_CONNECT_FAILED']:'Failed to connect to the ApolloDB',
    ServiceCodes['DUPLICATE_ID']:'Tried this request again while it is still running',
    ServiceCodes['DB_POP_FAILED']:'Failed getting the population from the ApolloDB',
    ServiceCodes['DB_POP_ZERO']:'ApolloDB query returned zero population',
    ServiceCodes['DB_QUERY_FAILED']:'ApolloDB query failed',
    ServiceCodes['GAIA_FILE_CREATION_FAILED']:'GAIA input file creation failed',
    ServiceCodes['GAIA_FILE_CREATION_COMPLETE']:'GAIA input file creation successful',
    ServiceCodes['CALLING_GAIA']:'Sent Call to the GAIA webservice',
    ServiceCodes['GAIA_FAILED']:'GAIA Service Call failed',
    ServiceCodes['GAIA_SUCCESS']:'GAIA Service return successfully',
    ServiceCodes['FILE_MOVE_FAILED']:'Moving movie file to web directory failed'
    }

ServiceTypes = {
    ServiceCodes['STARTED']:'RUNNING',
    ServiceCodes['CALLRECV']:'RUNNING',
    ServiceCodes['RUNNING']:'RUNNING',
    ServiceCodes['DB_ERROR']:'FAIL',
    ServiceCodes['UNKNOWN']:'RUNNING',
    ServiceCodes['COMPLETED']:'COMPLETED',
    ServiceCodes['DB_SUCCESS']:'RUNNING',
    ServiceCodes['DB_NOID_FOUND']:'FAILED',
    ServiceCodes['DB_CONNECT_SUCCESS']:'RUNNING',
    ServiceCodes['DB_CONNECT_FAILED']:'FAILED',
    ServiceCodes['DUPLICATE_ID']:'RUNNING',
    ServiceCodes['DB_POP_FAILED']:'FAILED',
    ServiceCodes['DB_POP_ZERO']:'FAILED',
    ServiceCodes['DB_QUERY_FAILED']:'FAILED',
    ServiceCodes['GAIA_FILE_CREATION_FAILED']:'FAILED',
    ServiceCodes['GAIA_FILE_CREATION_COMPLETE']:'RUNNING',
    ServiceCodes['CALLING_GAIA']:'RUNNING',
    ServiceCodes['GAIA_FAILED']:'FAILED',
    ServiceCodes['GAIA_SUCCESS']:'RUNNING',
    ServiceCodes['FILE_MOVE_FAILED']:'FAILED'
    }
class Log:
    def __init__(self, logFileName_=None,logLevel_ = "Normal", buffered_=False,append_=False):

        self.logFile = None
        try:
            if append_:
                self.logFile = open(logFileName_,"ab")
            else:
                self.logFile = open(logFileName_,"wb")
        except IOError:
            ### This error will prevent the server from starting, as it should
            raise RuntimeError("Cannot open the specified log file %s"%self.logFile)
        
        self.logLevel = logLevel_<commit_msg>Made all of the types lower case.<commit_after>import time
import os,sys

ServiceCodes = {
    'STARTED':101,
    'CALLRECV':102,
    'RUNNING':103,
    'DB_ERROR':104,
    'UNKNOWN':105,
    'COMPLETED':106,
    'DB_SUCCESS':107,
    'DB_NOID_FOUND':108,
    'DB_CONNECT_SUCCESS':109,
    'DB_CONNECT_FAILED':110,
    'DUPLICATE_ID':111,
    'DB_POP_FAILED':112,
    'DB_POP_ZERO':113,
    'DB_QUERY_FAILED':114,
    'GAIA_FILE_CREATION_FAILED':115,
    'GAIA_FILE_CREATION_COMPLETE':116,
    'CALLING_GAIA':117,
    'GAIA_FAILED':118,
    'GAIA_SUCCESS':119,
    'FILE_MOVE_FAILED':120
    }

ServiceDescriptions = {
    ServiceCodes['STARTED']:'Started Logging',
    ServiceCodes['CALLRECV']:'Incoming Call recieved',
    ServiceCodes['RUNNING']:'The service is Running',
    ServiceCodes['DB_ERROR']:'There has been an error in working accessing the ApolloDB',
    ServiceCodes['UNKNOWN']:'Unknown Status Code',
    ServiceCodes['COMPLETED']:'Completed creating visualizaton',
    ServiceCodes['DB_SUCCESS']:'Successfully obtained data from the ApolloDB',
    ServiceCodes['DB_NOID_FOUND']:'No ID found in ApolloDB',
    ServiceCodes['DB_CONNECT_SUCCESS']:'Successfully connected to the ApolloDB',
    ServiceCodes['DB_CONNECT_FAILED']:'Failed to connect to the ApolloDB',
    ServiceCodes['DUPLICATE_ID']:'Tried this request again while it is still running',
    ServiceCodes['DB_POP_FAILED']:'Failed getting the population from the ApolloDB',
    ServiceCodes['DB_POP_ZERO']:'ApolloDB query returned zero population',
    ServiceCodes['DB_QUERY_FAILED']:'ApolloDB query failed',
    ServiceCodes['GAIA_FILE_CREATION_FAILED']:'GAIA input file creation failed',
    ServiceCodes['GAIA_FILE_CREATION_COMPLETE']:'GAIA input file creation successful',
    ServiceCodes['CALLING_GAIA']:'Sent Call to the GAIA webservice',
    ServiceCodes['GAIA_FAILED']:'GAIA Service Call failed',
    ServiceCodes['GAIA_SUCCESS']:'GAIA Service return successfully',
    ServiceCodes['FILE_MOVE_FAILED']:'Moving movie file to web directory failed'
    }

ServiceTypes = {
    ServiceCodes['STARTED']:'running',
    ServiceCodes['CALLRECV']:'running',
    ServiceCodes['RUNNING']:'running',
    ServiceCodes['DB_ERROR']:'failed',
    ServiceCodes['UNKNOWN']:'running',
    ServiceCodes['COMPLETED']:'completed',
    ServiceCodes['DB_SUCCESS']:'running',
    ServiceCodes['DB_NOID_FOUND']:'failed',
    ServiceCodes['DB_CONNECT_SUCCESS']:'running',
    ServiceCodes['DB_CONNECT_FAILED']:'failed',
    ServiceCodes['DUPLICATE_ID']:'running',
    ServiceCodes['DB_POP_FAILED']:'failed',
    ServiceCodes['DB_POP_ZERO']:'failed',
    ServiceCodes['DB_QUERY_FAILED']:'failed',
    ServiceCodes['GAIA_FILE_CREATION_FAILED']:'failed',
    ServiceCodes['GAIA_FILE_CREATION_COMPLETE']:'running',
    ServiceCodes['CALLING_GAIA']:'running',
    ServiceCodes['GAIA_FAILED']:'failed',
    ServiceCodes['GAIA_SUCCESS']:'running',
    ServiceCodes['FILE_MOVE_FAILED']:'failed'
    }
class Log:
    def __init__(self, logFileName_=None,logLevel_ = "Normal", buffered_=False,append_=False):

        self.logFile = None
        try:
            if append_:
                self.logFile = open(logFileName_,"ab")
            else:
                self.logFile = open(logFileName_,"wb")
        except IOError:
            ### This error will prevent the server from starting, as it should
            raise RuntimeError("Cannot open the specified log file %s"%self.logFile)
        
        self.logLevel = logLevel_
{'fraction_non_alphanumeric': 0.13180639585133966, 'fraction_numerical': 0.01728608470181504, 'mean_word_length': 4.854131534569983, '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': '129180', 'n_tokens_mistral': 2251, 'n_tokens_neox': 2393, 'n_words': 383}