def handle(client_message, handle_event_member=None, handle_event_member_list=None, handle_event_member_attribute_change=None, to_object=None):
message_type = client_message.get_message_type()<EOL>if message_type == EVENT_MEMBER and handle_event_member is not None:<EOL><INDENT>member = MemberCodec.decode(client_message, to_object)<EOL>event_type = client_message.read_int()<EOL>handle_event_member(member=member, event_type=event_type)<EOL><DEDENT>if message_type == EVENT_MEMBERLIST and handle_event_member_list is not None:<EOL><INDENT>members_size = client_message.read_int()<EOL>members = []<EOL>for _ in range(<NUM_LIT:0>, members_size):<EOL><INDENT>members_item = MemberCodec.decode(client_message, to_object)<EOL>members.append(members_item)<EOL><DEDENT>handle_event_member_list(members=members)<EOL><DEDENT>if message_type == EVENT_MEMBERATTRIBUTECHANGE and handle_event_member_attribute_change is not None:<EOL><INDENT>uuid = client_message.read_str()<EOL>key = client_message.read_str()<EOL>operation_type = client_message.read_int()<EOL>value = None<EOL>if not client_message.read_bool():<EOL><INDENT>value = client_message.read_str()<EOL><DEDENT>handle_event_member_attribute_change(uuid=uuid, key=key, operation_type=operation_type, value=value)<EOL><DEDENT>
Event handler