def check_fields(self, room_id, sender, event_type):
        literal_keys = {
            "rooms": lambda v: room_id == v,
            "senders": lambda v: sender == v,
            "types": lambda v: _matches_wildcard(event_type, v)
        }

        for name, match_func in literal_keys.items():
            not_name = "not_%s" % (name,)
            disallowed_values = self.filter_json.get(not_name, [])
            if any(map(match_func, disallowed_values)):
                return False

            allowed_values = self.filter_json.get(name, None)
            if allowed_values is not None:
                if not any(map(match_func, allowed_values)):
                    return False

        return True
Checks whether the filter matches the given event fields.
dataset/ETHPy150Open matrix-org/synapse/synapse/api/filtering.py/Filter.check_fields