code: def test_setData():
      pdi = pg.PlotDataItem()
  
      # test empty data
      pdi.setData([])
  
      # test y data
      y = list(np.random.normal(size=100))
      pdi.setData(y)
      assert len(pdi.xData) == 100
      assert len(pdi.yData) == 100
  
      # test x, y data
      y += list(np.random.normal(size=50))
      x = np.linspace(5, 10, 150)
  
      pdi.setData(x, y)
      assert len(pdi.xData) == 150
      assert len(pdi.yData) == 150
  
      # test clear by empty call
      pdi.setData()
      assert pdi.xData is None
      assert pdi.yData is None
  
      # test dict of x, y list
      y += list(np.random.normal(size=50))
      x = list(np.linspace(5, 10, 200))
      pdi.setData({"x": x, "y": y})
      assert len(pdi.xData) == 200
      assert len(pdi.yData) == 200
  
      # test clear by zero length arrays call
      pdi.setData([], [])
      assert pdi.xData is None
      assert pdi.yData is None
  
file_path: pyqtgraph/tests/graphicsItems/test_PlotDataItem.py
imports: import warnings
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtGui
label_desc: Use image node_id 4 for calling a global function with example usage: test_setData() without return types