def _load_id_or_insert(self, session):
if self.id is None:<EOL><INDENT>stable_id = self.get_stable_id()<EOL>id = session.execute(<EOL>select([Context.id]).where(Context.stable_id == stable_id)<EOL>).first()<EOL>if id is None:<EOL><INDENT>self.id = session.execute(<EOL>Context.__table__.insert(),<EOL>{"<STR_LIT:type>": self._get_table().__tablename__, "<STR_LIT>": stable_id},<EOL>).inserted_primary_key[<NUM_LIT:0>]<EOL>insert_args = self._get_insert_args()<EOL>insert_args["<STR_LIT:id>"] = self.id<EOL>return insert_args<EOL><DEDENT>else:<EOL><INDENT>self.id = id[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>
Load the id of the temporary context if it exists or return insert args.

        As a side effect, this also inserts the Context object for the stableid.

        :return: The record of the temporary context to insert.
        :rtype: dict