code: def prohibit_commit(session):
      """
      Return a context manager that will disallow any commit that isn't done via the context manager.
  
      The aim of this is to ensure that transaction lifetime is strictly controlled which is especially
      important in the core scheduler loop. Any commit on the session that is _not_ via this context manager
      will result in RuntimeError
  
      Example usage:
  
      .. code:: python
  
          with prohibit_commit(session) as guard:
              # ... do something with session
              guard.commit()
  
              # This would throw an error
              # session.commit()
      """
      return CommitProhibitorGuard(session)
  
imports: from __future__ import annotations
  import contextlib
  import copy
  import datetime
  import json
  import logging
  from typing import TYPE_CHECKING, Any, Generator, Iterable, overload
  from dateutil import relativedelta
  from sqlalchemy import TIMESTAMP, PickleType, event, nullsfirst, tuple_
  from sqlalchemy.dialects import mysql
  from sqlalchemy.types import JSON, Text, TypeDecorator
  from airflow.configuration import conf
  from airflow.serialization.enums import Encoding
  from airflow.utils.timezone import make_naive, utc
label_desc: Use image node_id 8 for calling a global function with example usage: prohibit_commit(session) and returns: CommitProhibitorGuard