@defer.inlineCallbacks
    def add_account_data_for_user(self, user_id, account_data_type, content):
        content_json = json.dumps(content)

        def add_account_data_txn(txn, next_id):
            self._simple_upsert_txn(
                txn,
                table="account_data",
                keyvalues={
                    "user_id": user_id,
                    "account_data_type": account_data_type,
                },
                values={
                    "stream_id": next_id,
                    "content": content_json,
                }
            )
            txn.call_after(
                self._account_data_stream_cache.entity_has_changed,
                user_id, next_id,
            )
            self._update_max_stream_id(txn, next_id)

        with self._account_data_id_gen.get_next() as next_id:
            yield self.runInteraction(
                "add_user_account_data", add_account_data_txn, next_id
            )

        result = self._account_data_id_gen.get_max_token()
        defer.returnValue(result)
Take multiple layers and stylesheets and turn it into a Mapnik input file
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/account_data.py/AccountDataStore.add_account_data_for_user--crossover with--dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/drivers/__init__.py/compile_mml