code: def test_session_uses_bind_key(
      app: Flask, model_class: t.Any
  ) -> None:
      app.config["SQLALCHEMY_BINDS"] = {"a": "sqlite://"}
      db = SQLAlchemy(app, model_class=model_class)
  
      if issubclass(
          db.Model,
          (sa_orm.DeclarativeBase, sa_orm.DeclarativeBaseNoMeta),
      ):
  
          class User(db.Model):
              id: sa_orm.Mapped[int] = sa_orm.mapped_column(
                  sa.Integer, primary_key=True
              )
  
          class Post(db.Model):
              __bind_key__ = "a"
              id: sa_orm.Mapped[int] = sa_orm.mapped_column(
                  sa.Integer, primary_key=True
              )
  
      else:
  
          class User(db.Model):  # type: ignore[no-redef]
              id = sa.Column(sa.Integer, primary_key=True)
  
          class Post(db.Model):  # type: ignore[no-redef]
              __bind_key__ = "a"
              id = sa.Column(sa.Integer, primary_key=True)
  
      assert db.session.get_bind(mapper=User) is db.engine
      assert db.session.get_bind(mapper=Post) is db.engines["a"]
  
file_path: flask-sqlalchemy/tests/test_session.py
imports: from __future__ import annotations
  import typing
  import pytest
  import sqlalchemy
  import sqlalchemy.orm
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  from flask_sqlalchemy.session import Session
label_desc: Use image node_id 4 for calling a global function with example usage: test_session_uses_bind_key(app, model_class) without return types