@cached()
    def get_tags_for_user(self, user_id):

        deferred = self._simple_select_list(
            "room_tags", {"user_id": user_id}, ["room_id", "tag", "content"]
        )

        @deferred.addCallback
        def tags_by_room(rows):
            tags_by_room = {}
            for row in rows:
                room_tags = tags_by_room.setdefault(row["room_id"], {})
                room_tags[row["tag"]] = json.loads(row["content"])
            return tags_by_room

        return deferred
Get all the tags for a user.
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/tags.py/TagsStore.get_tags_for_user