class_docstr: Implements a custom Tornado WebSocketHandler for the Bokeh Server.
  
      
docstr: Clean up when the connection is closed.
  
          
docstr_tok: ["Clean","up","when","the","connection","is","closed","."]
code: def on_close(self) -> None:
      """Clean up when the connection is closed."""
      log.info(
          "WebSocket connection closed: code=%s, reason=%r",
          self.close_code,
          self.close_reason,
      )
      if self.connection is not None:
          self.connection.session.notify_connection_lost()
          self.application.client_lost(self.connection)
  
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 8 for calling the WSHandler obj's underlying member method code with example usage: obj.on_close() without return types