class_docstr: the class to get Pool info.
class_docstr_tok: ["the","class","to","get","Pool","info","."]
docstr: Get the number of slots used by queued tasks at the moment.
  
  :param session: SQLAlchemy ORM Session
  :return: the used number of slots
docstr_tok: ["Get","the","number","of","slots","used","by","queued","tasks","at","the","moment",".",":","param","session",":","SQLAlchemy","ORM","Session",":","return",":","the","used","number","of","slots"]
code: def queued_slots(self, session: Session = NEW_SESSION) -> int:
      """
      Get the number of slots used by queued tasks at the moment.
  
      :param session: SQLAlchemy ORM Session
      :return: the used number of slots
      """
      from airflow.models.taskinstance import (
          TaskInstance,
      )  # Avoid circular import
  
      return int(
          session.scalar(
              select(func.sum(TaskInstance.pool_slots))
              .filter(TaskInstance.pool == self.pool)
              .filter(TaskInstance.state == TaskInstanceState.QUEUED)
          )
          or 0
      )
  
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 13 for calling the Pool obj's underlying member method code with example usage: obj.queued_slots(session) and returns: int