code: def has_access_pool(method: ResourceMethod) -> Callable[[T], T]:
      def has_access_decorator(func: T):
          @wraps(func)
          def decorated(*args, **kwargs):
              pools: set[Pool] = set(args[1])
              requests: Sequence[IsAuthorizedPoolRequest] = [
                  {
                      "method": method,
                      "details": PoolDetails(name=pool.pool),
                  }
                  for pool in pools
              ]
              is_authorized = (
                  get_auth_manager().batch_is_authorized_pool(requests)
              )
              return _has_access(
                  is_authorized=is_authorized,
                  func=func,
                  args=args,
                  kwargs=kwargs,
              )
  
          return cast(T, decorated)
  
      return has_access_decorator
  
imports: from __future__ import annotations
  import functools
  import logging
  import warnings
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, Sequence, TypeVar, cast
  from flask import flash, redirect, render_template, request, url_for
  from flask_appbuilder._compat import as_unicode
  from flask_appbuilder.const import FLAMSG_ERR_SEC_ACCESS_DENIED, LOGMSG_ERR_SEC_ACCESS_DENIED, PERMISSION_PREFIX
  from airflow.auth.managers.models.resource_details import AccessView, ConnectionDetails, DagAccessEntity, DagDetails, PoolDetails, VariableDetails
  from airflow.configuration import conf
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.utils.net import get_hostname
  from airflow.www.extensions.init_auth_manager import get_auth_manager
label_desc: Use image node_id 11 for calling a global function with example usage: has_access_pool(method) and returns: has_access_decorator, cast, _has_access