code: def test_cbmo002_all_and_match_output(with_simple, dash_duo):
      app = Dash(__name__)
  
      app.layout = html.Div(
          children=[
              html.Button("items", id="items"),
              html.Button("values", id="values"),
              html.Div(id="content"),
          ]
      )
  
      @app.callback(
          Output("content", "children"), [Input("items", "n_clicks")]
      )
      def set_content(n1):
          return [
              html.Div(
                  [
                      html.Div(
                          [
                              html.Div(id={"i": i, "j": j})
                              for i in range(((n1 or 0) + j) % 4)
                          ],
                          className="content{}".format(j),
                      ),
                      html.Div(
                          id={"j": j}, className="output{}".format(j)
                      ),
                      html.Hr(),
                  ]
              )
              for j in range(4)
          ]
  
      # these two variants have identical results, but the internal behavior
      # is different when you combine the callbacks.
      if with_simple:
  
          @app.callback(
              [
                  Output({"i": ALL, "j": MATCH}, "children"),
                  Output({"j": MATCH}, "children"),
              ],
              [
                  Input("values", "n_clicks"),
                  Input({"i": ALL, "j": MATCH}, "id"),
              ],
          )
          def content_and_output(n2, content_ids):
              # this variant *does* get called with empty ALL, because of the
              # second Output
              # TODO: however it doesn't get *triggered* by the ALL emptying,
              # should it? for now, added content_ids to get proper triggering.
              n1 = len(content_ids)
              content = [n2 or 0] * n1
              return content, sum(content)
  
      else:
  
          @app.callback(
              Output({"i": ALL, "j": MATCH}, "children"),
              [Input("values", "n_clicks")],
          )
          def content_inner(n2):
              # this variant does NOT get called with empty ALL
              # the second callback handles outputting 0 in that case.
              # if it were to be called throw an error so we'll see it in get_logs
              n1 = len(dash.callback_context.outputs_list)
              if not n1:
                  raise ValueError(
                      "should not be called with no outputs!"
                  )
              return [n2 or 0] * n1
  
          @app.callback(
              Output({"j": MATCH}, "children"),
              [Input({"i": ALL, "j": MATCH}, "children")],
          )
          def out2(contents):
              return sum(contents)
  
      dash_duo.start_server(app, **debugging)
  
      dash_duo.wait_for_text_to_equal(".content0", "")
      dash_duo.wait_for_text_to_equal(".output0", "0")
  
      actions = [
          [
              "#values",
              [["", "0"], ["1", "1"], ["1\n1", "2"], ["1\n1\n1", "3"]],
          ],
          [
              "#items",
              [["1", "1"], ["1\n1", "2"], ["1\n1\n1", "3"], ["", "0"]],
          ],
          [
              "#values",
              [["2", "2"], ["2\n2", "4"], ["2\n2\n2", "6"], ["", "0"]],
          ],
          [
              "#items",
              [["2\n2", "4"], ["2\n2\n2", "6"], ["", "0"], ["2", "2"]],
          ],
          [
              "#values",
              [["3\n3", "6"], ["3\n3\n3", "9"], ["", "0"], ["3", "3"]],
          ],
          [
              "#items",
              [["3\n3\n3", "9"], ["", "0"], ["3", "3"], ["3\n3", "6"]],
          ],
          [
              "#values",
              [["4\n4\n4", "12"], ["", "0"], ["4", "4"], ["4\n4", "8"]],
          ],
          [
              "#items",
              [["", "0"], ["4", "4"], ["4\n4", "8"], ["4\n4\n4", "12"]],
          ],
          [
              "#values",
              [
                  ["", "0"],
                  ["5", "5"],
                  ["5\n5", "10"],
                  ["5\n5\n5", "15"],
              ],
          ],
          [
              "#items",
              [
                  ["5", "5"],
                  ["5\n5", "10"],
                  ["5\n5\n5", "15"],
                  ["", "0"],
              ],
          ],
      ]
      for selector, output_spec in actions:
          dash_duo.find_element(selector).click()
          for j, (content, output) in enumerate(output_spec):
              dash_duo.wait_for_text_to_equal(
                  ".content{}".format(j), content
              )
              dash_duo.wait_for_text_to_equal(
                  ".output{}".format(j), output
              )
  
      assert not dash_duo.get_logs()
  
file_path: dash/tests/integration/callbacks/test_missing_outputs.py
imports: import pytest
  from multiprocessing import Lock, Value
  import dash
  from dash import Dash, Input, Output, ALL, MATCH, html, dcc
  from dash.testing.wait import until
label_desc: Use image node_id 2 for calling a global function with example usage: test_cbmo002_all_and_match_output(with_simple, dash_duo) and returns: unknown, content,  sum, unknown, sum