class_docstr: Explicitly coordinate the level Tornado components required to run a
  Bokeh server:
  
  * A Tornado ``IOLoop`` to run the Bokeh server machinery.
  
  * a ``BokehTornado`` Tornado application that defines the Bokeh server
    machinery.
  
  * a Tornado ``HTTPServer`` to direct HTTP requests
  
  All three of these components must be passed to ``BaseServer``, which will
  initialize the ``BokehTornado`` instance on the ``io_loop``. The
  ``http_server`` must have been previously created and initialized with the
  ``BokehTornado`` instance.
docstr: Gets all currently active sessions for applications.
  
  Args:
      app_path (str, optional) :
          The configured application path for the application to return
          sessions for. If None, return active sessions for all
          applications. (default: None)
  
  Returns:
      list[ServerSession]
docstr_tok: ["Gets","all","currently","active","sessions","for","applications",".","Args",":","app_path","(","str",",","optional",")",":","The","configured","application","path","for","the","application","to","return","sessions","for",".","If","None",",","return","active","sessions","for","all","applications",".","(","default",":","None",")","Returns",":","list","[","ServerSession","]"]
code: def get_sessions(
      self, app_path: str | None = None
  ) -> list[ServerSession]:
      """Gets all currently active sessions for applications.
  
      Args:
          app_path (str, optional) :
              The configured application path for the application to return
              sessions for. If None, return active sessions for all
              applications. (default: None)
  
      Returns:
          list[ServerSession]
  
      """
      if app_path is not None:
          return self._tornado.get_sessions(app_path)
      all_sessions: list[ServerSession] = []
      for path in self._tornado.app_paths:
          all_sessions += self._tornado.get_sessions(path)
      return all_sessions
  
imports: from __future__ import annotations
  import logging
  import atexit
  import signal
  import socket
  import sys
  from types import FrameType
  from typing import TYPE_CHECKING, Any, Mapping
  from tornado import netutil, version
  from tornado.httpserver import HTTPServer
  from tornado.ioloop import IOLoop
  from ..None import __version__
  from ..core import properties
  from ..core.properties import Bool, Int, Nullable, String
  from ..resources import DEFAULT_SERVER_PORT, server_url
  from ..util.options import Options
  from .tornado import DEFAULT_WEBSOCKET_MAX_MESSAGE_SIZE_BYTES, BokehTornado
  from .util import bind_sockets, create_hosts_allowlist
label_desc: Use image node_id 8 for calling the BaseServer obj's underlying member method code with example usage: obj.get_sessions(app_path) and returns: all_sessions, self