class_docstr: Load a script which contains server request handler callbacks.
  
      
class_docstr_tok: ["Load","a","script","which","contains","server","request","handler","callbacks","."]
docstr: Keyword Args:
      filename (str) : path to a module to load request handler callbacks from
  
      argv (list[str], optional) : a list of string arguments to use as
          ``sys.argv`` when the callback code is executed. (default: [])
docstr_tok: ["Keyword","Args",":","filename","(","str",")",":","path","to","a","module","to","load","request","handler","callbacks","from","argv","(","list","[","str","]",",","optional",")",":","a","list","of","string","arguments","to","use","as","``","sys.argv","``","when","the","callback","code","is","executed",".","(","default",":","[","]",")"]
code: def __init__(
      self,
      *,
      filename: PathLike,
      argv: list[str] = [],
      package: ModuleType | None = None,
  ) -> None:
      """
  
      Keyword Args:
          filename (str) : path to a module to load request handler callbacks from
  
          argv (list[str], optional) : a list of string arguments to use as
              ``sys.argv`` when the callback code is executed. (default: [])
  
      """
      super().__init__()
  
      with open(filename, encoding="utf-8") as f:
          source = f.read()
  
      self._runner = CodeRunner(source, filename, argv, package=package)
  
      if not self._runner.failed:
          # unlike ScriptHandler, we only load the module one time
          self._module = self._runner.new_module()
  
          def extract_callbacks() -> None:
              contents = self._module.__dict__
              if "process_request" in contents:
                  self._process_request = contents["process_request"]
  
              _check_callback(
                  self._process_request,
                  ("request",),
                  what="process_request",
              )
  
          self._runner.run(self._module, extract_callbacks)
  
file_path: bokeh/src/bokeh/application/handlers/server_request_handler.py
imports: from __future__ import annotations
  import logging
  import os
  from types import ModuleType
  from ...core.types import PathLike
  from ...util.callback_manager import _check_callback
  from .code_runner import CodeRunner
  from .request_handler import RequestHandler
label_desc: Use image node_id 1 to create a new ServerRequestHandler object from inherited base classes: RequestHandler with example: obj = ServerRequestHandler()