code: def format_docstring(
      docstring: str | None, *args: Any, **kwargs: Any
  ) -> str | None:
      """Safely format docstrings.
  
      When Python is executed with the ``-OO`` option, doc strings are removed and
      replaced the value ``None``. This function guards against applying the string
      formatting options in that case.
  
      Args:
          docstring (str or None) : The docstring to format, or ``None``
          args (tuple) : string formatting arguments for the docsring
          kwargs (dict) : string formatting arguments for the docsring
  
      Returns:
          str or None
  
      """
      return (
          None
          if docstring is None
          else docstring.format(*args, **kwargs)
      )
  
file_path: bokeh/src/bokeh/util/strings.py
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any, Iterable, overload
  from urllib.parse import quote_plus
label_desc: Use image node_id 7 for calling a global function with example usage: format_docstring(docstring) and returns: unknown