code: def create_user(app_context: AppContext):
      def _create_user(
          username: str, role: str = "Admin", password: str = "general"
      ):
          security_manager.add_user(
              username,
              "firstname",
              "lastname",
              "email@exaple.com",
              security_manager.find_role(role),
              password,
          )
          return security_manager.find_user(username)
  
      return _create_user
  
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 5 for calling a global function with example usage: create_user(app_context) and returns: _create_user, security_manager