code: def test_data_race():
      # Ensure widgets don't override user setting of param values whether
      # they connect the signal before or after it's added to a tree
      p = pt.Parameter.create(name="int", type="int", value=0)
      t = pt.ParameterTree()
  
      def override():
          p.setValue(1)
  
      p.sigValueChanged.connect(override)
      t.setParameters(p)
      pi = next(iter(p.items))
      assert pi.param is p
      pi.widget.setValue(2)
      assert p.value() == pi.widget.value() == 1
      p.sigValueChanged.disconnect(override)
      p.sigValueChanged.connect(override)
      pi.widget.setValue(2)
      assert p.value() == pi.widget.value() == 1
  
file_path: pyqtgraph/tests/parametertree/test_parametertypes.py
imports: from unittest.mock import MagicMock
  import numpy
  import pyqtgraph
  import pyqtgraph.parametertree
  from pyqtgraph.functions import eq
  from pyqtgraph.parametertree.parameterTypes import ChecklistParameterItem
  from pyqtgraph.Qt import QtCore, QtGui
label_desc: Use image node_id 6 for calling a global function with example usage: test_data_race() without return types