code: def test_grva013_toggle_mathjax(dash_dcc, is_eager):
      app = Dash(__name__, eager_loading=is_eager)
  
      gravity = "$F=\\frac{Gm_1m_2}{r^2}$"
  
      app.layout = html.Div(
          [
              html.Button("Toggle MathJax", id="btn"),
              dcc.Graph(
                  id="gd",
                  figure={
                      "data": [{"y": [3, 1, 2]}],
                      "layout": {"title": {"text": gravity}},
                  },
              ),
          ]
      )
  
      @app.callback(
          Output("gd", "mathjax"),
          Input("btn", "n_clicks"),
          prevent_initial_call=True,
      )
      def toggle(n):
          return (n or 0) % 2 != 0
  
      dash_dcc.start_server(app)
  
      # Initial state: no MathJax loaded or rendered, unformatted text is shown
      dash_dcc.wait_for_contains_text(".gtitle", gravity)
  
      # Note: in eager mode, the async-mathjax bundle IS loaded, but it seems like
      # it isn't executed until we ask for MathJax with import()
      assert not dash_dcc.driver.execute_script(
          "return !!window.MathJax"
      )
  
      btn = dash_dcc.find_element("#btn")
      btn.click()
  
      # One click: MathJax is rendered, unformatted text is gone
  
      dash_dcc.wait_for_element(".gtitle-math")
      assert dash_dcc.driver.execute_script("return !!window.MathJax")
  
      btn.click()
  
      # Second click: Back to initial state except that MathJax library is still loaded
      dash_dcc.wait_for_contains_text(".gtitle", gravity)
      dash_dcc.wait_for_no_elements(".gtitle-math")
      assert dash_dcc.driver.execute_script("return !!window.MathJax")
  
imports: import pytest
  import time
  import json
  import werkzeug
  from selenium.webdriver import ActionChains
  from dash import Dash, Input, Output, State, dcc, html
  from dash.exceptions import PreventUpdate
  from dash.testing.wait import until
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions
label_desc: Use image node_id 15 for calling a global function with example usage: test_grva013_toggle_mathjax(dash_dcc, is_eager) and returns: unknown