code: def fibonacci_app(clientside):
      global fibonacci_count
      global fibonacci_sum_count
  
      fibonacci_count = 0
      fibonacci_sum_count = 0
  
      # This app tests 2 things in particular:
      # - clientside callbacks work the same as server-side
      # - callbacks using ALLSMALLER as an input to MATCH of the exact same id/prop
      app = Dash(__name__)
      app.layout = html.Div(
          [
              dcc.Input(id="n", type="number", min=0, max=10, value=4),
              html.Div(id="series"),
              html.Div(id="sum"),
          ]
      )
  
      @app.callback(Output("series", "children"), Input("n", "value"))
      def items(n):
          return [html.Div(id={"i": i}) for i in range(n)]
  
      if clientside:
          app.clientside_callback(
              """
              function(vals) {
                  var len = vals.length;
                  return len < 2 ? len : +(vals[len - 1] || 0) + +(vals[len - 2] || 0);
              }
              """,
              Output({"i": MATCH}, "children"),
              Input({"i": ALLSMALLER}, "children"),
          )
  
          app.clientside_callback(
              """
              function(vals) {
                  var sum = vals.reduce(function(a, b) { return +a + +b; }, 0);
                  return vals.length + ' elements, sum: ' + sum;
              }
              """,
              Output("sum", "children"),
              Input({"i": ALL}, "children"),
          )
  
      else:
  
          @app.callback(
              Output({"i": MATCH}, "children"),
              Input({"i": ALLSMALLER}, "children"),
          )
          def sequence(prev):
              global fibonacci_count
              fibonacci_count = fibonacci_count + 1
              print(fibonacci_count)
  
              if len(prev) < 2:
                  return len(prev)
              return int(prev[-1] or 0) + int(prev[-2] or 0)
  
          @app.callback(
              Output("sum", "children"), Input({"i": ALL}, "children")
          )
          def show_sum(seq):
              global fibonacci_sum_count
              fibonacci_sum_count = fibonacci_sum_count + 1
              print("fibonacci_sum_count: ", fibonacci_sum_count)
  
              return "{} elements, sum: {}".format(
                  len(seq), sum(int(v or 0) for v in seq)
              )
  
      return app
  
file_path: dash/tests/integration/callbacks/test_wildcards.py
imports: import pytest
  import re
  from selenium.webdriver.common.keys import Keys
  import json
  from dash.testing import wait
  import dash
  from dash import Dash, Input, Output, State, ALL, ALLSMALLER, MATCH, html, dcc
  from tests.assets.todo_app import todo_app
  from tests.assets.grouping_app import grouping_app
label_desc: Use image node_id 4 for calling a global function with example usage: fibonacci_app(clientside) and returns: app, unknown, unknown, str, len