<commit_before>from __future__ import absolute_import

from sc2reader.utils import Length, LITTLE_ENDIAN
from sc2reader.data import Unit
from sc2reader.log_utils import loggable

@loggable
class Event(object):
    name = 'Event'

    def __init__(self, frame, pid):
        self.pid = pid
        self.frame = frame
        self.second = frame >> 4
        self.time = Length(seconds=self.second)
        if not hasattr(self, 'name'):
            self.name = self.__class__.__name__

    def load_context(self, replay):
        if self.pid != 16:
            self.player = replay.person[self.pid]

    def _str_prefix(self):
        player_name = self.player.name if getattr(self,'pid', 16)!=16 else "Global"<commit_msg>Don't override name on initialization.<commit_after>from __future__ import absolute_import

from sc2reader.utils import Length, LITTLE_ENDIAN
from sc2reader.data import Unit
from sc2reader.log_utils import loggable

@loggable
class Event(object):
    name = 'Event'

    def __init__(self, frame, pid):
        self.pid = pid
        self.frame = frame
        self.second = frame >> 4
        self.time = Length(seconds=self.second)

    def load_context(self, replay):
        if self.pid != 16:
            self.player = replay.person[self.pid]

    def _str_prefix(self):
        player_name = self.player.name if getattr(self,'pid', 16)!=16 else "Global"
{'fraction_non_alphanumeric': 0.10007251631617115, 'fraction_numerical': 0.014503263234227702, 'mean_word_length': 2.9884393063583814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3175630', 'n_tokens_mistral': 446, 'n_tokens_neox': 418, 'n_words': 113}