<commit_before>class Entry(object):

    def __init__(self, logfile=None, pos=None, raw_entry=None):
        self.timestamp, self.log_type, self.log_text = raw_entry.split('\t')
        self._uuid = _generate_uuid()
        
    def __str__(self):
        return "%0.4f\t%s\t%s" % (self.timestamp, self.log_type, self.log_text)

    @property
    def klass(self):
        return self.__class__.__name__.lower()
    
    @property
    def log_text(self):
        try:
            return self._log_text
        except:
            return None

    @log_text.setter
    def log_text(self, _text):
        self._log_text = _text

    @property
    def log_type(self):
        try:
            return self._log_type
        except:
            return None

    @log_type.setter
    def log_type(self, _type):
        self._log_type = _type

    @property
    def name(self):
        try:
            return self._name
        except:
            return self.__class__.__name__.lower()
        
    @name.setter
    def name(self, new_name):
        self._name = new_name 
    
    @property
    def timestamp(self):
        try:
            return self._timestamp
        except:
            return None

    @timestamp.setter
    def timestamp(self, _timestamp):
        self._timestamp = float(_timestamp)
        
    @property
    def uuid(self):
        return str(self._uuid)
    
    def as_dict(self):
        return {
                'class': self.klass,
                'log_text': self.log_text,
                'name': self.name,
                'timestamp': self.timestamp
                }
    
# MODULE LEVEL FUNCTIONS
def read(logfile=None, pos=None, raw_entry=None):
    # send entry on to propper parser based on type
    _,log_type,_ = raw_entry.split('\t')
    if log_type == 'DATA':
        import user_input
        return user_input.read(logfile, pos, raw_entry)
    elif log_type == 'EXP':
        import exp_data
        return exp_data.read(logfile, pos, raw_entry)
    elif log_type == 'DEBUG':
        pass
    elif log_type == 'INFO':
        pass
    else:
        print "I do not handle the following entry: %s" % Entry(logfile,pos,raw_entry)
        
def _generate_uuid():
    import uuid
    return uuid.uuid4()
<commit_msg>Logfile should ignore WARNING entries whilst parsing.<commit_after>class Entry(object):

    def __init__(self, logfile=None, pos=None, raw_entry=None):
        self.timestamp, self.log_type, self.log_text = raw_entry.split('\t')
        self._uuid = _generate_uuid()
        
    def __str__(self):
        return "%0.4f\t%s\t%s" % (self.timestamp, self.log_type, self.log_text)

    @property
    def klass(self):
        return self.__class__.__name__.lower()
    
    @property
    def log_text(self):
        try:
            return self._log_text
        except:
            return None

    @log_text.setter
    def log_text(self, _text):
        self._log_text = _text

    @property
    def log_type(self):
        try:
            return self._log_type
        except:
            return None

    @log_type.setter
    def log_type(self, _type):
        self._log_type = _type

    @property
    def name(self):
        try:
            return self._name
        except:
            return self.__class__.__name__.lower()
        
    @name.setter
    def name(self, new_name):
        self._name = new_name 
    
    @property
    def timestamp(self):
        try:
            return self._timestamp
        except:
            return None

    @timestamp.setter
    def timestamp(self, _timestamp):
        self._timestamp = float(_timestamp)
        
    @property
    def uuid(self):
        return str(self._uuid)
    
    def as_dict(self):
        return {
                'class': self.klass,
                'log_text': self.log_text,
                'name': self.name,
                'timestamp': self.timestamp
                }
    
# MODULE LEVEL FUNCTIONS
def read(logfile=None, pos=None, raw_entry=None):
    # send entry on to propper parser based on type
    _,log_type,_ = raw_entry.split('\t')
    if log_type == 'DATA':
        import user_input
        return user_input.read(logfile, pos, raw_entry)
    elif log_type == 'EXP':
        import exp_data
        return exp_data.read(logfile, pos, raw_entry)
    elif log_type == 'DEBUG':
        pass
    elif log_type == 'INFO':
        pass
    elif log_type == 'WARNING':
        pass
    else:
        print "I do not handle the following entry: %s" % Entry(logfile,pos,raw_entry)
        
def _generate_uuid():
    import uuid
    return uuid.uuid4()

{'fraction_non_alphanumeric': 0.09806057964698191, 'fraction_numerical': 0.0013074743952930922, 'mean_word_length': 1.870544090056285, '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': '202841', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1397, 'n_words': 334}