class_docstr: the class to get Pool info.
class_docstr_tok: ["the","class","to","get","Pool","info","."]
docstr: Create a pool with given parameters or update it if it already exists.
docstr_tok: ["Create","a","pool","with","given","parameters","or","update","it","if","it","already","exists","."]
code: def create_or_update_pool(
      name: str,
      slots: int,
      description: str,
      include_deferred: bool,
      session: Session = NEW_SESSION,
  ) -> Pool:
      """Create a pool with given parameters or update it if it already exists."""
      if not name:
          raise ValueError("Pool name must not be empty")
  
      pool = session.scalar(select(Pool).filter_by(pool=name))
      if pool is None:
          pool = Pool(
              pool=name,
              slots=slots,
              description=description,
              include_deferred=include_deferred,
          )
          session.add(pool)
      else:
          pool.slots = slots
          pool.description = description
          pool.include_deferred = include_deferred
  
      session.commit()
      return pool
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any
  from sqlalchemy import Boolean, Column, Integer, String, Text, func, select
  from airflow.exceptions import AirflowException, PoolNotFound
  from airflow.models.base import Base
  from airflow.ti_deps.dependencies_states import EXECUTION_STATES
  from airflow.typing_compat import TypedDict
  from airflow.utils.db import exists_query
  from airflow.utils.session import NEW_SESSION, provide_session
  from airflow.utils.sqlalchemy import nowait, with_row_locks
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 6 for calling the Pool obj's underlying member method code with example usage: obj.create_or_update_pool(name, slots, description, include_deferred, session) and returns: pool