code: def test_scatterplotitem():
      app = pg.mkQApp()
  
      plot = pg.PlotWidget()
      # set view range equal to its bounding rect.
      # This causes plots to look the same regardless of pxMode.
      plot.setRange(rect=plot.boundingRect())
  
      # test SymbolAtlas accepts custom symbol
      s = pg.ScatterPlotItem(name="Scatter")
      symbol = QtGui.QPainterPath()
      symbol.addEllipse(QtCore.QRectF(-0.5, -0.5, 1, 1))
      s.addPoints([{"pos": [0, 0], "data": 1, "symbol": symbol}])
  
      assert s.name() == "Scatter"
  
      for i, pxMode in enumerate([True, False]):
          for j, useCache in enumerate([True, False]):
              s = pg.ScatterPlotItem()
              s.opts["useCache"] = useCache
              plot.addItem(s)
              s.setData(
                  x=np.array([10, 40, 20, 30]) + i * 100,
                  y=np.array([40, 60, 10, 30]) + j * 100,
                  pxMode=pxMode,
                  name="MoreScatter",
              )
              s.addPoints(
                  x=np.array([60, 70]) + i * 100,
                  y=np.array([60, 70]) + j * 100,
                  size=[20, 30],
              )
  
              assert s.name() == "MoreScatter"
              # Test uniform spot updates
              s.setSize(10)
              s.setBrush("r")
              s.setPen("g")
              s.setSymbol("+")
              app.processEvents()
  
              # Test list spot updates
              s.setSize([10] * 6)
              s.setBrush([pg.mkBrush("r")] * 6)
              s.setPen([pg.mkPen("g")] * 6)
              s.setSymbol(["+"] * 6)
              s.setPointData([s] * 6)
              app.processEvents()
  
              # Test array spot updates
              s.setSize(np.array([10] * 6))
              s.setBrush(np.array([pg.mkBrush("r")] * 6))
              s.setPen(np.array([pg.mkPen("g")] * 6))
              s.setSymbol(np.array(["+"] * 6))
              s.setPointData(np.array([s] * 6))
              app.processEvents()
  
              # Test per-spot updates
              spot = s.points()[0]
              spot.setSize(20)
              spot.setBrush("b")
              spot.setPen("g")
              spot.setSymbol("o")
              spot.setData(None)
              app.processEvents()
  
      plot.close()
  
imports: import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtCore, QtGui
label_desc: Use image node_id 1 for calling a global function with example usage: test_scatterplotitem() without return types