code: def test_clip_to_item_in_other_vb():
      """LRI clip to item in a different ViewBox"""
      init_vals = (10, 50)
      img_shape = (20, 20)
  
      win = pg.GraphicsLayoutWidget()
  
      # "remote" PlotDataItem to bound to
      p1 = win.addPlot()
      img = pg.ImageItem(image=np.eye(*img_shape))
      p1.addItem(img)
  
      # plot the LRI lives in
      p2 = win.addPlot()
      x2 = np.linspace(-200, 200, 100)
      p2.plot(x=x2, y=x2)
  
      lr = pg.LinearRegionItem(init_vals)
      p2.addItem(lr)
      app.processEvents()
  
      # no clip item set yet, should be initial bounds
      check_region(lr, init_vals, exact=True)
  
      lr.setClipItem(img)
      app.processEvents()
  
      # snap to image width
      check_region(lr, (init_vals[0], img_shape[1]), exact=True)
  
file_path: pyqtgraph/tests/graphicsItems/test_LinearRegionItem.py
imports: import math
  import numpy
  import pytest
  import pyqtgraph
label_desc: Use image node_id 4 for calling a global function with example usage: test_clip_to_item_in_other_vb() without return types