class_docstr: Implements a custom Tornado WebSocketHandler for the Bokeh Server.
  
      
code: def select_subprotocol(self, subprotocols: list[str]) -> str | None:
      log.debug("Subprotocol header received")
      log.trace("Supplied subprotocol headers: %r", subprotocols)
      if not len(subprotocols) == 2:
          return None
      self._token = subprotocols[1]
      return subprotocols[0]
  
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 5 for calling the WSHandler obj's underlying member method code with example usage: obj.select_subprotocol(subprotocols) and returns: subprotocols, None