def notification_received(self, notification):
        try:
            skype = self.skype
            skype._CallEventHandler('Notify', notification)
            a, b = chop(notification)
            object_type = None
            # if..elif handling cache and most event handlers
            if a in ('CALL', 'USER', 'GROUP', 'CHAT', 'CHATMESSAGE', 'CHATMEMBER', 'VOICEMAIL', 'APPLICATION', 'SMS', 'FILETRANSFER'):
                object_type, object_id, prop_name, value = [a] + chop(b, 2)
                skype._CacheDict[str(object_type), str(object_id), str(prop_name)] = value
                if object_type == 'USER':
                    o = User(skype, object_id)
                    if prop_name == 'ONLINESTATUS':
                        skype._CallEventHandler('OnlineStatus', o, str(value))
                    elif prop_name == 'MOOD_TEXT' or prop_name == 'RICH_MOOD_TEXT':
                        skype._CallEventHandler('UserMood', o, value)
                    elif prop_name == 'RECEIVEDAUTHREQUEST':
                        skype._CallEventHandler('UserAuthorizationRequestReceived', o)
                elif object_type == 'CALL':
                    o = Call(skype, object_id)
                    if prop_name == 'STATUS':
                        skype._CallEventHandler('CallStatus', o, str(value))
                    elif prop_name == 'SEEN':
                        skype._CallEventHandler('CallSeenStatusChanged', o, (value == 'TRUE'))
                    elif prop_name == 'VAA_INPUT_STATUS':
                        skype._CallEventHandler('CallInputStatusChanged', o, (value == 'TRUE'))
                    elif prop_name == 'TRANSFER_STATUS':
                        skype._CallEventHandler('CallTransferStatusChanged', o, str(value))
                    elif prop_name == 'DTMF':
                        skype._CallEventHandler('CallDtmfReceived', o, str(value))
                    elif prop_name == 'VIDEO_STATUS':
                        skype._CallEventHandler('CallVideoStatusChanged', o, str(value))
                    elif prop_name == 'VIDEO_SEND_STATUS':
                        skype._CallEventHandler('CallVideoSendStatusChanged', o, str(value))
                    elif prop_name == 'VIDEO_RECEIVE_STATUS':
                        skype._CallEventHandler('CallVideoReceiveStatusChanged', o, str(value))
                elif object_type == 'CHAT':
                    o = Chat(skype, object_id)
                    if prop_name == 'MEMBERS':
                        skype._CallEventHandler('ChatMembersChanged', o, UserCollection(skype, split(value)))
                    if prop_name in ('OPENED', 'CLOSED'):
                        skype._CallEventHandler('ChatWindowState', o, (prop_name == 'OPENED'))
                elif object_type == 'CHATMEMBER':
                    o = ChatMember(skype, object_id)
                    if prop_name == 'ROLE':
                        skype._CallEventHandler('ChatMemberRoleChanged', o, str(value))
                elif object_type == 'CHATMESSAGE':
                    o = ChatMessage(skype, object_id)
                    if prop_name == 'STATUS':
                        skype._CallEventHandler('MessageStatus', o, str(value))
                elif object_type == 'APPLICATION':
                    o = Application(skype, object_id)
                    if prop_name == 'CONNECTING':
                        skype._CallEventHandler('ApplicationConnecting', o, UserCollection(skype, split(value)))
                    elif prop_name == 'STREAMS':
                        skype._CallEventHandler('ApplicationStreams', o, ApplicationStreamCollection(o, split(value)))
                    elif prop_name == 'DATAGRAM':
                        handle, text = chop(value)
                        skype._CallEventHandler('ApplicationDatagram', o, ApplicationStream(o, handle), text)
                    elif prop_name == 'SENDING':
                        skype._CallEventHandler('ApplicationSending', o, ApplicationStreamCollection(o, (x.split('=')[0] for x in split(value))))
                    elif prop_name == 'RECEIVED':
                        skype._CallEventHandler('ApplicationReceiving', o, ApplicationStreamCollection(o, (x.split('=')[0] for x in split(value))))
                elif object_type == 'GROUP':
                    o = Group(skype, object_id)
                    if prop_name == 'VISIBLE':
                        skype._CallEventHandler('GroupVisible', o, (value == 'TRUE'))
                    elif prop_name == 'EXPANDED':
                        skype._CallEventHandler('GroupExpanded', o, (value == 'TRUE'))
                    elif prop_name == 'NROFUSERS':
                        skype._CallEventHandler('GroupUsers', o, int(value))
                elif object_type == 'SMS':
                    o = SmsMessage(skype, object_id)
                    if prop_name == 'STATUS':
                        skype._CallEventHandler('SmsMessageStatusChanged', o, str(value))
                    elif prop_name == 'TARGET_STATUSES':
                        for t in split(value, ', '):
                            number, status = t.split('=')
                            skype._CallEventHandler('SmsTargetStatusChanged', SmsTarget(o, number), str(status))
                elif object_type == 'FILETRANSFER':
                    o = FileTransfer(skype, object_id)
                    if prop_name == 'STATUS':
                        skype._CallEventHandler('FileTransferStatusChanged', o, str(value))
                elif object_type == 'VOICEMAIL':
                    o = Voicemail(skype, object_id)
                    if prop_name == 'STATUS':
                        skype._CallEventHandler('VoicemailStatus', o, str(value))
            elif a in ('PROFILE', 'PRIVILEGE'):
                object_type, object_id, prop_name, value = [a, ''] + chop(b)
                skype._CacheDict[str(object_type), str(object_id), str(prop_name)] = value
            elif a in ('CURRENTUSERHANDLE', 'USERSTATUS', 'CONNSTATUS', 'PREDICTIVE_DIALER_COUNTRY', 'SILENT_MODE', 'AUDIO_IN', 'AUDIO_OUT', 'RINGER', 'MUTE', 'AUTOAWAY', 'WINDOWSTATE'):
                object_type, object_id, prop_name, value = [a, '', '', b]
                skype._CacheDict[str(object_type), str(object_id), str(prop_name)] = value
                if object_type == 'MUTE':
                    skype._CallEventHandler('Mute', value == 'TRUE')
                elif object_type == 'CONNSTATUS':
                    skype._CallEventHandler('ConnectionStatus', str(value))
                elif object_type == 'USERSTATUS':
                    skype._CallEventHandler('UserStatus', str(value))
                elif object_type == 'AUTOAWAY':
                    skype._CallEventHandler('AutoAway', (value == 'ON'))
                elif object_type == 'WINDOWSTATE':
                    skype._CallEventHandler('ClientWindowState', str(value))
                elif object_type == 'SILENT_MODE':
                    skype._CallEventHandler('SilentModeStatusChanged', (value == 'ON'))
            elif a == 'CALLHISTORYCHANGED':
                skype._CallEventHandler('CallHistory')
            elif a == 'IMHISTORYCHANGED':
                skype._CallEventHandler('MessageHistory', '') # XXX: Arg is Skypename, which one?
            elif a == 'CONTACTS':
                prop_name, value = chop(b)
                if prop_name == 'FOCUSED':
                    skype._CallEventHandler('ContactsFocused', str(value))
            elif a == 'DELETED':
                prop_name, value = chop(b)
                if prop_name == 'GROUP':
                    skype._CallEventHandler('GroupDeleted', int(value))
            elif a == 'EVENT':
                object_id, prop_name, value = chop(b, 2)
                if prop_name == 'CLICKED':
                    skype._CallEventHandler('PluginEventClicked', PluginEvent(skype, object_id))
            elif a == 'MENU_ITEM':
                object_id, prop_name, value = chop(b, 2)
                if prop_name == 'CLICKED':
                    i = value.rfind('CONTEXT ')
                    if i >= 0:
                        context = chop(value[i+8:])[0]
                        users = ()
                        context_id = u''
                        if context in (pluginContextContact, pluginContextCall, pluginContextChat):
                            users = UserCollection(skype, split(value[:i-1], ', '))
                        if context in (pluginContextCall, pluginContextChat):
                            j = value.rfind('CONTEXT_ID ')
                            if j >= 0:
                                context_id = str(chop(value[j+11:])[0])
                                if context == pluginContextCall:
                                    context_id = int(context_id)
                        skype._CallEventHandler('PluginMenuItemClicked', PluginMenuItem(skype, object_id), users, str(context), context_id)
            elif a == 'WALLPAPER':
                skype._CallEventHandler('WallpaperChanged', unicode2path(b))
        except weakref.ReferenceError:
            pass
dataset/ETHPy150Open Skype4Py/Skype4Py/Skype4Py/skype.py/APINotifier.notification_received/original