code: def test_quadrilateral_relations():
      i = Interval(4, 5, axis="y")
      q = Quadrilateral(np.array([[2, 2], [6, 2], [6, 7], [2, 5]]))
      r = Rectangle(3, 3, 5, 6)
  
      assert not q.is_in(r)
      assert q.is_in(i, soft_margin={"top": 2, "bottom": 2})
      assert q.is_in(
          r, soft_margin={"left": 1, "top": 1, "right": 1, "bottom": 1}
      )
      assert q.is_in(q)
  
      # convert to absolute then convert back to relative
      assert q.condition_on(i).relative_to(i) == q
      assert q.condition_on(r).relative_to(r) == q
      assert q.condition_on(q).relative_to(q) == q
  
      # convert to relative then convert back to absolute
      assert q.relative_to(i).condition_on(i) == q
      assert q.relative_to(r).condition_on(r) == q
      assert q.relative_to(q).condition_on(q) == q
  
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 6 for calling a global function with example usage: test_quadrilateral_relations() without return types