code: def Todo(
      app: Flask, db: SQLAlchemy
  ) -> t.Generator[t.Any, None, None]:
      if issubclass(db.Model, (sa_orm.MappedAsDataclass)):
  
          class Todo(db.Model):
              id: sa_orm.Mapped[int] = sa_orm.mapped_column(
                  sa.Integer, init=False, primary_key=True
              )
              title: sa_orm.Mapped[str] = sa_orm.mapped_column(
                  sa.String, nullable=True, default=None
              )
  
      elif issubclass(
          db.Model,
          (sa_orm.DeclarativeBase, sa_orm.DeclarativeBaseNoMeta),
      ):
  
          class Todo(db.Model):  # type: ignore[no-redef]
              id: sa_orm.Mapped[int] = sa_orm.mapped_column(
                  sa.Integer, primary_key=True
              )
              title: sa_orm.Mapped[str] = sa_orm.mapped_column(
                  sa.String, nullable=True
              )
  
      else:
  
          class Todo(db.Model):  # type: ignore[no-redef]
              id = sa.Column(sa.Integer, primary_key=True)
              title = sa.Column(sa.String)
  
      with app.app_context():
          db.create_all()
  
      yield Todo
  
      with app.app_context():
          db.drop_all()
  
file_path: flask-sqlalchemy/tests/conftest.py
imports: from __future__ import annotations
  import types
  import typing
  from pathlib import Path
  import pytest
  import sqlalchemy
  import sqlalchemy.orm
  from flask import Flask
  from flask.ctx import AppContext
  from flask_sqlalchemy import SQLAlchemy
  from flask_sqlalchemy.model import Model
label_desc: Use image node_id 5 for calling a global function with example usage: Todo(app, db) without return types