<commit_before># Copyright (C) 2004 <NAME>


class Event(object):
    """
    """
    def getEventName(self):
        return self.__class__.__name__

    def _extraRepr(self):
        return ''

    def __repr__(self):
        e = self._extraRepr()
        if e: e = '(%s) '%e
        return '<%s %sat %x>'%(self.__class__.__name__, e, id(self))

class    DTMFReceivedEvent(Event):
    """ Received some DTMF keystrokes.
    """
    def __init__(self, digits, leg):
        self.digits = digits
        self.leg = leg

    def _extraRepr(self):
        return str(self.digits)

class        DTMFTimeoutEvent(DTMFReceivedEvent):
    """ A timeout occurred while collecting DTMF.

        Any digits collected will be returned in this object's digits
        attribute.
    """

class    MediaDoneEvent(Event):
    """ A media play/record completed
    """
    def __init__(self, source, leg):
        self.source = source
        self.leg = leg

    def _extraRepr(self):
        return repr(self.source)

class        MediaPlayDoneEvent(MediaDoneEvent):
    """ A mediaPlay completed
    """

class            MediaPlayContentDoneEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because it finished with the content
    """

class            MediaPlayContentFailedEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because the source of audio failed
    """

class            MediaPlayUserBargeInEvent(DTMFReceivedEvent,
                                           MediaPlayDoneEvent):
    """ A mediaPlay completed because the user hit a key
    """

class            MediaPlayTimerExpiredEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because a timeout was exceeded
    """

class            MediaPlayRemoteClosedEvent(MediaPlayDoneEvent):
    """
    """


class        MediaRecordDoneEvent(MediaDoneEvent):
    """ media record done
    """

class            MediaRecordRemoteClosedEvent(MediaRecordDoneEvent):
    """ A media record ended because the remote end closed the call
    """

class            MediaRecordTimeoutExceededEvent(MediaRecordDoneEvent):
    """ A media record ended because a specified timeout was exceeded
    """

class            MediaRecordFailedEvent(MediaRecordDoneEvent):
    """ A media record failed
    """

class                MediaRecordStoreFailedEvent(MediaRecordDoneEvent):
    """ A media record failed because the storage didn't work
    """

class    CallLegEvent(Event):
    """ A call event associated with a Leg
    """
    def __init__(self, leg):
        self.leg = leg

    def getLeg(self):
        return self.leg

    def _extraRepr(self):
        return repr(self.leg)


class      CallAnsweredEvent(CallLegEvent):
    """ A call was connected
    """

class      CallRejectedEvent(CallLegEvent):
    """ A call was rejected
    """
    def __init__(self, reason=''):
        self.reason = reason

    def _extraRepr(self):
        return repr(self.reason)

class      CallStartedEvent(CallLegEvent):
    """ A call started
    """

class        InboundCallStartedEvent(CallStartedEvent):
    """ A new inbound call started
    """<commit_msg>default args<commit_after># Copyright (C) 2004 <NAME>


class Event(object):
    """
    """
    def getEventName(self):
        return self.__class__.__name__

    def _extraRepr(self):
        return ''

    def __repr__(self):
        e = self._extraRepr()
        if e: e = '(%s) '%e
        return '<%s %sat %x>'%(self.__class__.__name__, e, id(self))

class    DTMFReceivedEvent(Event):
    """ Received some DTMF keystrokes.
    """
    def __init__(self, digits, leg):
        self.digits = digits
        self.leg = leg

    def _extraRepr(self):
        return str(self.digits)

class        DTMFTimeoutEvent(DTMFReceivedEvent):
    """ A timeout occurred while collecting DTMF.

        Any digits collected will be returned in this object's digits
        attribute.
    """

class    MediaDoneEvent(Event):
    """ A media play/record completed
    """
    def __init__(self, source, leg):
        self.source = source
        self.leg = leg

    def _extraRepr(self):
        return repr(self.source)

class        MediaPlayDoneEvent(MediaDoneEvent):
    """ A mediaPlay completed
    """

class            MediaPlayContentDoneEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because it finished with the content
    """

class            MediaPlayContentFailedEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because the source of audio failed
    """

class            MediaPlayUserBargeInEvent(DTMFReceivedEvent,
                                           MediaPlayDoneEvent):
    """ A mediaPlay completed because the user hit a key
    """

class            MediaPlayTimerExpiredEvent(MediaPlayDoneEvent):
    """ A mediaPlay completed because a timeout was exceeded
    """

class            MediaPlayRemoteClosedEvent(MediaPlayDoneEvent):
    """
    """


class        MediaRecordDoneEvent(MediaDoneEvent):
    """ media record done
    """

class            MediaRecordRemoteClosedEvent(MediaRecordDoneEvent):
    """ A media record ended because the remote end closed the call
    """

class            MediaRecordTimeoutExceededEvent(MediaRecordDoneEvent):
    """ A media record ended because a specified timeout was exceeded
    """

class            MediaRecordFailedEvent(MediaRecordDoneEvent):
    """ A media record failed
    """

class                MediaRecordStoreFailedEvent(MediaRecordDoneEvent):
    """ A media record failed because the storage didn't work
    """

class    CallLegEvent(Event):
    """ A call event associated with a Leg
    """
    def __init__(self, leg):
        self.leg = leg

    def getLeg(self):
        return self.leg

    def _extraRepr(self):
        return repr(self.leg)


class      CallAnsweredEvent(CallLegEvent):
    """ A call was connected
    """

class      CallRejectedEvent(CallLegEvent):
    """ A call was rejected
    """
    def __init__(self, reason=''):
        self.reason = reason

    def _extraRepr(self):
        return repr(self.reason)

class      CallStartedEvent(CallLegEvent):
    """ A call started
    """
    args = None

class        InboundCallStartedEvent(CallStartedEvent):
    """ A new inbound call started
    """
{'fraction_non_alphanumeric': 0.09506310912286307, 'fraction_numerical': 0.0012781594503914362, 'mean_word_length': 2.514879281302639, 'pattern_counts': {'":': 0, '<': 7, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1641060', 'n_tokens_mistral': 1739, 'n_tokens_neox': 1676, 'n_words': 477}