<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from EmeraldAI.Entities.BaseObject import BaseObject
from EmeraldAI.Logic.Singleton import Singleton
from datetime import datetime

# TODO

class User(BaseObject):
    __metaclass__ = Singleton
    # This class is a singleton as we only need one instance across the whole project, the currently active user

    CVTag = None

    Name = "Unknown"
    LastName = None
    FirstName = None

    Gender = "Male"
    Birthday = None

    LastSeen = None
    LastSpokenTo = None

    Properties = []

    Formal = True
    Trainer = False
    Admin = False

    Updated = None

    def GetCVTag(self):
        return self.CVTag

    def SetUserByCVTag(self, cvTag, deepProcess=True):
        if cvTag == None:
            return

        self.CVTag = cvTag
        if not deepProcess:
            return

        # TODO - get details from DB
        self.Name = cvTag

        self.Updated = datetime.now().strftime("%H%M")
        #######

    def GetName(self):
        return self.Name

    def SetUserByName(self, name, deepProcess=True):
        if name == None:
            return

        self.Name = name

        if not deepProcess:
            return

        # TODO - get details from DB
        self.Name = cvTag

        self.Updated = datetime.now().strftime("%H%M")
        #######<commit_msg>Skip setting user if it's already set<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
from EmeraldAI.Entities.BaseObject import BaseObject
from EmeraldAI.Logic.Singleton import Singleton
from datetime import datetime

# TODO

class User(BaseObject):
    __metaclass__ = Singleton
    # This class is a singleton as we only need one instance across the whole project, the currently active user

    CVTag = None

    Name = "Unknown"
    LastName = None
    FirstName = None

    Gender = "Male"
    Birthday = None

    LastSeen = None
    LastSpokenTo = None

    Properties = []

    Formal = True
    Trainer = False
    Admin = False

    Updated = None

    def GetCVTag(self):
        return self.CVTag

    def SetUserByCVTag(self, cvTag, deepProcess=True):
        if cvTag == None or self.CVTag == cvTag:
            return

        self.CVTag = cvTag
        if not deepProcess:
            return

        # TODO - get details from DB
        self.Name = cvTag

        self.Updated = datetime.now().strftime("%H%M")
        #######

    def GetName(self):
        return self.Name

    def SetUserByName(self, name, deepProcess=True):
        if name == None or self.Name == name:
            return

        self.Name = name

        if not deepProcess:
            return

        # TODO - get details from DB
        self.Name = cvTag

        self.Updated = datetime.now().strftime("%H%M")
        #######
{'fraction_non_alphanumeric': 0.09218077474892396, 'fraction_numerical': 0.0007173601147776184, 'mean_word_length': 2.048087431693989, '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': '4792063', 'n_tokens_mistral': 829, 'n_tokens_neox': 785, 'n_words': 248}