code: def test_interval_relations():
      i = Interval(4, 5, axis="y")
      r = Rectangle(3, 3, 5, 6)
      q = Quadrilateral(np.array([[2, 2], [6, 2], [6, 7], [2, 5]]))
  
      assert i.is_in(i)
      assert i.is_in(r)
      assert i.is_in(q)
  
      # convert to absolute then convert back to relative
      assert i.condition_on(i).relative_to(i) == i
      assert (
          i.condition_on(r).relative_to(r)
          == i.put_on_canvas(r).to_rectangle()
      )
      assert (
          i.condition_on(q).relative_to(q)
          == i.put_on_canvas(q).to_quadrilateral()
      )
  
      # convert to relative then convert back to absolute
      assert i.relative_to(i).condition_on(i) == i
      assert (
          i.relative_to(r).condition_on(r)
          == i.put_on_canvas(r).to_rectangle()
      )
      assert (
          i.relative_to(q).condition_on(q)
          == i.put_on_canvas(q).to_quadrilateral()
      )
  
file_path: layout-parser/tests/test_elements.py
imports: import pytest
  import numpy
  import pandas
  from layoutparser.elements import Interval, Rectangle, Quadrilateral, TextBlock, Layout
  from layoutparser.elements.errors import InvalidShapeError, NotSupportedShapeError
label_desc: Use image node_id 4 for calling a global function with example usage: test_interval_relations() without return types