code: def __init__(
      self,
      request: HTTPServerRequest,
      arguments: dict[str, bytes | list[bytes]] | None = None,
      cookies: dict[str, str] | None = None,
      headers: dict[str, str | list[str]] | None = None,
  ) -> None:
      self._request = request
  
      if arguments is not None:
          self._arguments = arguments
      elif hasattr(request, "arguments"):
          self._arguments = dict(request.arguments)
      else:
          self._arguments = {}
      if "bokeh-session-id" in self._arguments:
          del self._arguments["bokeh-session-id"]
  
      if cookies is not None:
          self._cookies = cookies
      elif hasattr(request, "cookies"):
          # Django cookies are plain strings, tornado cookies are objects with a value
          self._cookies = {
              k: v if isinstance(v, str) else v.value
              for k, v in request.cookies.items()
          }
      else:
          self._cookies = {}
  
      if headers is not None:
          self._headers = headers
      elif hasattr(request, "headers"):
          self._headers = dict(request.headers)
      else:
          self._headers = {}
  
imports: from __future__ import annotations
  import logging
  import weakref
  from typing import TYPE_CHECKING, Any, Awaitable, Callable, Iterable
  from tornado import gen
  from ..application.application import ServerContext, SessionContext
  from ..document import Document
  from ..protocol.exceptions import ProtocolError
  from ..util.token import get_token_payload
  from .session import ServerSession
label_desc: Use image node_id 1 to create a new _RequestProxy object  with example: obj = _RequestProxy(request, arguments, cookies, headers)