code: def test_cbsc007_parallel_updates(refresh, dash_duo):
      # This is a funny case, that seems to mostly happen with dcc.Location
      # but in principle could happen in other cases too:
      # A callback chain (in this case the initial hydration) is set to update a
      # value, but after that callback is queued and before it returns, that value
      # is also set explicitly from the front end (in this case Location.pathname,
      # which gets set in its componentDidMount during the render process, and
      # callbacks are delayed until after rendering is finished because of the
      # async table)
      # At one point in the wildcard PR #1103, changing from requestQueue to
      # pendingCallbacks, calling PreventUpdate in the callback would also skip
      # any callbacks that depend on pathname, despite the new front-end-provided
      # value.
  
      app = Dash()
  
      app.layout = html.Div(
          [
              dcc.Location(id="loc", refresh=refresh),
              html.Button("Update path", id="btn"),
              dash_table.DataTable(
                  id="t", columns=[{"name": "a", "id": "a"}]
              ),
              html.Div(id="out"),
          ]
      )
  
      @app.callback(Output("t", "data"), [Input("loc", "pathname")])
      def set_data(path):
          return [{"a": (path or repr(path)) + ":a"}]
  
      @app.callback(
          Output("out", "children"),
          [Input("loc", "pathname"), Input("t", "data")],
      )
      def set_out(path, data):
          return json.dumps(data) + " - " + (path or repr(path))
  
      @app.callback(
          Output("loc", "pathname"), [Input("btn", "n_clicks")]
      )
      def set_path(n):
          if not n:
              raise PreventUpdate
  
          return "/{0}".format(n)
  
      dash_duo.start_server(app)
  
      dash_duo.wait_for_text_to_equal("#out", '[{"a": "/:a"}] - /')
      dash_duo.find_element("#btn").click()
      # the refresh=True case here is testing that we really do get the right
      # pathname, not the prevented default value from the layout.
      dash_duo.wait_for_text_to_equal("#out", '[{"a": "/1:a"}] - /1')
      if not refresh:
          dash_duo.find_element("#btn").click()
          dash_duo.wait_for_text_to_equal(
              "#out", '[{"a": "/2:a"}] - /2'
          )
  
imports: import json
  import os
  from multiprocessing import Lock, Value
  import pytest
  import time
  import numpy
  import werkzeug
  from dash_test_components import AsyncComponent, CollapseComponent, DelayedEventComponent, FragmentComponent
  from dash import Dash, Input, Output, State, html, dcc, dash_table, no_update, callback_context
  from dash.exceptions import PreventUpdate
  from tests.integration.utils import json_engine
label_desc: Use image node_id 7 for calling a global function with example usage: test_cbsc007_parallel_updates(refresh, dash_duo) and returns: list, unknown, str