code: def test_PlotItem_preserve_external_visibility_control():
      item = pg.PlotItem()
      curve1 = pg.PlotDataItem(np.random.normal(size=10))
      curve2 = pg.PlotDataItem(np.random.normal(size=10))
      item.addItem(curve1)
      curve1.hide()
      item.addItem(curve2)
      assert not curve1.isVisible()
      item.removeItem(curve2)
      assert not curve1.isVisible()
  
file_path: pyqtgraph/tests/graphicsItems/PlotItem/test_PlotItem.py
imports: import numpy
  import pytest
  import pyqtgraph
label_desc: Use image node_id 6 for calling a global function with example usage: test_PlotItem_preserve_external_visibility_control() without return types