code: def example_query(
      get_or_create_user: Callable[..., ContextManager[ab_models.User]]
  ):
      with get_or_create_user("sqllab-test-user") as user:
          query = Query(
              client_id=shortid()[:10],
              database=get_example_database(),
              user=user,
          )
          db.session.add(query)
          db.session.commit()
          yield query
          db.session.delete(query)
          db.session.commit()
  
file_path: superset/tests/integration_tests/sql_lab/conftest.py
imports: import contextlib
  from typing import Callable, ContextManager
  import pytest
  from flask_appbuilder.security.sqla import models
  from superset import db
  from superset.models.sql_lab import Query
  from superset.utils.core import shortid
  from superset.utils.database import get_example_database
label_desc: Use image node_id 4 for calling a global function with example usage: example_query(get_or_create_user) without return types