code: def _listen(session: sa_orm.scoped_session[Session]) -> None:
      sa_event.listen(session, "before_flush", _record_ops, named=True)
      sa_event.listen(session, "before_commit", _record_ops, named=True)
      sa_event.listen(session, "before_commit", _before_commit)
      sa_event.listen(session, "after_commit", _after_commit)
      sa_event.listen(session, "after_rollback", _after_rollback)
  
file_path: flask-sqlalchemy/src/flask_sqlalchemy/track_modifications.py
imports: from __future__ import annotations
  import typing
  import sqlalchemy
  import sqlalchemy.event
  import sqlalchemy.orm
  from flask import current_app
  from flask import has_app_context
  from flask.signals import Namespace
label_desc: Use image node_id 1 for calling a global function with example usage: _listen(session) without return types