code: def check_region(lr, bounds, exact=False, rtol=0.005):
      """Optionally tolerant LinearRegionItem region check"""
      reg = lr.getRegion()
      if exact:
          assert reg[0] == bounds[0]
          assert reg[1] == bounds[1]
      else:
          assert math.isclose(reg[0], bounds[0], rel_tol=rtol)
          assert math.isclose(reg[1], bounds[1], rel_tol=rtol)
  
file_path: pyqtgraph/tests/graphicsItems/test_LinearRegionItem.py
imports: import math
  import numpy
  import pytest
  import pyqtgraph
label_desc: Use image node_id 1 for calling a global function with example usage: check_region(lr, bounds, exact, rtol) without return types