code: def pool_factory(session):
      def factory(**values):
          pool = Pool(
              **{**POOL, **values}
          )  # Passed in values override defaults.
          session.add(pool)
          session.commit()
          return pool
  
      return factory
  
file_path: airflow/tests/www/views/test_anonymous_as_admin_role.py
imports: from __future__ import annotations
  import pytest
  from airflow.models import Pool
  from airflow.utils.session import create_session
  from tests.test_utils.www import check_content_in_response
label_desc: Use image node_id 2 for calling a global function with example usage: pool_factory(session) and returns: factory, pool