code: def test_cbcx006_initial_callback_predecessor(dash_duo):
      class context:
          calls = 0
          callback_contexts = []
  
      app = Dash(__name__)
      app.layout = html.Div(
          [
              html.Div(
                  style={"display": "block"},
                  children=[
                      html.Div(
                          [
                              html.Label("ID: input-number-1"),
                              dcc.Input(
                                  id="input-number-1",
                                  type="number",
                                  value=0,
                              ),
                          ]
                      ),
                      html.Div(
                          [
                              html.Label("ID: input-number-2"),
                              dcc.Input(
                                  id="input-number-2",
                                  type="number",
                                  value=0,
                              ),
                          ]
                      ),
                      html.Div(
                          [
                              html.Label("ID: sum-number"),
                              dcc.Input(
                                  id="sum-number",
                                  type="number",
                                  value=0,
                                  disabled=True,
                              ),
                          ]
                      ),
                  ],
              ),
              html.Div(id="results"),
          ]
      )
  
      @app.callback(
          Output("sum-number", "value"),
          [
              Input("input-number-1", "value"),
              Input("input-number-2", "value"),
          ],
      )
      def update_sum_number(n1, n2):
          context.calls = context.calls + 1
          context.callback_contexts.append(callback_context.triggered)
  
          return n1 + n2
  
      @app.callback(
          Output("results", "children"),
          [
              Input("input-number-1", "value"),
              Input("input-number-2", "value"),
              Input("sum-number", "value"),
          ],
      )
      def update_results(n1, n2, nsum):
          context.calls = context.calls + 1
          context.callback_contexts.append(callback_context.triggered)
  
          return [
              "{} + {} = {}".format(n1, n2, nsum),
              html.Br(),
              "ctx.triggered={}".format(callback_context.triggered),
          ]
  
      dash_duo.start_server(app)
  
      # Initial Callbacks
      wait.until(lambda: context.calls == 2, 2)
      wait.until(lambda: len(context.callback_contexts) == 2, 2)
  
      keys0 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[0],
          )
      )
      # Special case present for backward compatibility
      assert len(keys0) == 1
      assert "." in keys0
  
      keys1 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[1],
          )
      )
      assert len(keys1) == 1
      assert "sum-number.value" in keys1
  
      # User action & followup callbacks
      dash_duo.find_element("#input-number-1").click()
      dash_duo.find_element("#input-number-1").send_keys("1")
  
      wait.until(lambda: context.calls == 4, 2)
      wait.until(lambda: len(context.callback_contexts) == 4, 2)
  
      keys0 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[2],
          )
      )
      # Special case present for backward compatibility
      assert len(keys0) == 1
      assert "input-number-1.value" in keys0
  
      keys1 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[3],
          )
      )
      assert len(keys1) == 2
      assert "sum-number.value" in keys1
      assert "input-number-1.value" in keys1
  
      dash_duo.find_element("#input-number-2").click()
      dash_duo.find_element("#input-number-2").send_keys("1")
  
      wait.until(lambda: context.calls == 6, 2)
      wait.until(lambda: len(context.callback_contexts) == 6, 2)
  
      keys0 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[4],
          )
      )
      # Special case present for backward compatibility
      assert len(keys0) == 1
      assert "input-number-2.value" in keys0
  
      keys1 = list(
          map(
              operator.itemgetter("prop_id"),
              context.callback_contexts[5],
          )
      )
      assert len(keys1) == 2
      assert "sum-number.value" in keys1
      assert "input-number-2.value" in keys1
  
file_path: dash/tests/integration/callbacks/test_callback_context.py
imports: import json
  import operator
  import pytest
  from dash import Dash, ALL, Input, Output, html, dcc, callback_context, ctx
  from dash.exceptions import PreventUpdate, MissingCallbackContextException
  import dash.testing.wait
  from selenium.webdriver.common.action_chains import ActionChains
label_desc: Use image node_id 6 for calling a global function with example usage: test_cbcx006_initial_callback_predecessor(dash_duo) and returns: unknown, list