code: def login_as(test_client: FlaskClient[Any]):
      """Fixture with app context and logged in admin user."""
  
      def _login_as(username: str, password: str = "general"):
          login(test_client, username=username, password=password)
  
      yield _login_as
  
imports: from __future__ import annotations
  import contextlib
  import functools
  import os
  from typing import Any, Callable, TYPE_CHECKING
  from unittest.mock import patch
  import pytest
  from flask.ctx import AppContext
  from flask_appbuilder.security.sqla import models
  from sqlalchemy.engine import Engine
  from superset import db, security_manager
  from superset.extensions import feature_flag_manager
  from superset.utils.core import json_dumps_w_dates
  from superset.utils.database import get_example_database, remove_database
  from tests.integration_tests.test_app import app, login
label_desc: Use image node_id 3 for calling a global function with example usage: login_as(test_client) without return types