class_docstr: Implements a custom Tornado WebSocketHandler for the Bokeh Server.
  
      
code: def get_compression_options(self) -> dict[str, Any] | None:
      if self._compression_level is None:
          return None
      options = {"compression_level": self._compression_level}
      if self._mem_level is not None:
          options["mem_level"] = self._mem_level
      return options
  
imports: from __future__ import annotations
  import logging
  import calendar
  import datetime
  from typing import TYPE_CHECKING, Any, cast
  from urllib.parse import urlparse
  from tornado import locks, web
  from tornado.websocket import WebSocketClosedError, WebSocketHandler
  from bokeh.settings import settings
  from bokeh.util.token import check_token_signature, get_session_id, get_token_payload
  from ...protocol import Protocol
  from ...protocol.exceptions import MessageError, ProtocolError, ValidationError
  from ...protocol.message import Message
  from ...protocol.receiver import Receiver
  from ...util.dataclasses import dataclass
  from ..protocol_handler import ProtocolHandler
  from .auth_request_handler import AuthRequestHandler
label_desc: Use image node_id 6 for calling the WSHandler obj's underlying member method code with example usage: obj.get_compression_options() and returns: options, None