code: def test_get_or_404(db: SQLAlchemy, Todo: t.Any) -> None:
      item = Todo()
      db.session.add(item)
      db.session.commit()
      assert db.get_or_404(Todo, 1) is item
  
      with pytest.raises(NotFound):
          db.get_or_404(Todo, 2)
  
file_path: flask-sqlalchemy/tests/test_extension_object.py
imports: from __future__ import annotations
  import typing
  import pytest
  import sqlalchemy
  import sqlalchemy.orm
  from flask import Flask
  from werkzeug.exceptions import NotFound
  from flask_sqlalchemy import SQLAlchemy
  from flask_sqlalchemy.record_queries import get_recorded_queries
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_or_404(db, Todo) without return types