@defer.inlineCallbacks
    def action_for_event_by_user(self, event, handler, current_state):
        actions_by_user = {}

        users_dict = yield self.store.are_guests(self.rules_by_user.keys())

        filtered_by_user = yield handler.filter_events_for_clients(
            users_dict.items(), [event], {event.event_id: current_state}
        )

        room_members = yield self.store.get_users_in_room(self.room_id)

        evaluator = PushRuleEvaluatorForEvent(event, len(room_members))

        condition_cache = {}

        display_names = {}
        for ev in current_state.values():
            nm = ev.content.get("displayname", None)
            if nm and ev.type == EventTypes.Member:
                display_names[ev.state_key] = nm

        for uid, rules in self.rules_by_user.items():
            display_name = display_names.get(uid, None)

            filtered = filtered_by_user[uid]
            if len(filtered) == 0:
                continue

            if filtered[0].sender == uid:
                continue

            for rule in rules:
                if rule in 'enabled' and not rule['enabled']:
                    continue

                matches = _condition_checker(
                    evaluator, rule['conditions'], uid, display_name, condition_cache
                )
                if matches:
                    actions = [x for x in rule['actions'] if x != 'dont_notify']
                    if actions and 'notify' in actions:
                        actions_by_user[uid] = actions
                    break
        defer.returnValue(actions_by_user)
dataset/ETHPy150Open matrix-org/synapse/synapse/push/bulk_push_rule_evaluator.py/BulkPushRuleEvaluator.action_for_event_by_user/swapped operands of `in`