code: def _model_requires_mathjax(model: HasProps) -> bool:
      """Whether a model requires MathJax to be loaded
      Args:
          model (HasProps): HasProps to check
      Returns:
          bool: True if MathJax required, False if not
      """
      # TODO query model's properties that include TextLike or better
      # yet load mathjax bundle dynamically on bokehjs' side.
  
      from ..models.annotations import TextAnnotation
      from ..models.axes import Axis
      from ..models.widgets.markups import Div, Paragraph
      from ..models.widgets.sliders import AbstractSlider
  
      if isinstance(model, TextAnnotation):
          if isinstance(model.text, str) and contains_tex_string(
              model.text
          ):
              return True
  
      if isinstance(model, AbstractSlider):
          if isinstance(model.title, str) and contains_tex_string(
              model.title
          ):
              return True
  
      if isinstance(model, Axis):
          if isinstance(model.axis_label, str) and contains_tex_string(
              model.axis_label
          ):
              return True
  
          for val in model.major_label_overrides.values():
              if isinstance(val, str) and contains_tex_string(val):
                  return True
  
      if (
          isinstance(model, Div)
          and not model.disable_math
          and not model.render_as_text
      ):
          if contains_tex_string(model.text):
              return True
  
      if isinstance(model, Paragraph) and not model.disable_math:
          if contains_tex_string(model.text):
              return True
  
      return False
  
imports: from __future__ import annotations
  import logging
  import hashlib
  import json
  import os
  from dataclasses import dataclass
  from os.path import normpath
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable, Iterator, Sequence, TypedDict
  from urllib.parse import urljoin
  from ..core.has_props import HasProps
  from ..core.templates import CSS_RESOURCES, JS_RESOURCES
  from ..document.document import Document
  from ..resources import Resources
  from ..settings import settings
  from ..util.compiler import bundle_models
  from .util import contains_tex_string
label_desc: Use image node_id 8 for calling a global function with example usage: _model_requires_mathjax(model) and returns: False, True, True, True, True, True, True