code: def test_rectintersect():
      a = rect(pt(0, 0), pt(1, 1))
      b = rect(pt(-3, -1), pt(2, 5))
  
      assert rectintersect(a, a) == rectarea(a)
      assert rectintersect(b, b) == rectarea(b)
      assert rectintersect(a, a, norm_intersect_area="a") == 1
      assert rectintersect(a, a, norm_intersect_area="b") == 1
  
      with pytest.raises(ValueError):
          rectintersect(a, a, norm_intersect_area="c")
  
      # complete intersect
      assert rectintersect(a, b) == rectarea(a)
      assert rectintersect(b, a) == rectarea(a)
      assert rectintersect(a, b, norm_intersect_area="a") == 1
      assert rectintersect(b, a, norm_intersect_area="b") == 1
      assert rectintersect(b, a, norm_intersect_area="a") < 1
      assert rectintersect(a, b, norm_intersect_area="b") < 1
  
      # partial intersect
      a = rect(pt(0, 0), pt(1, 1))
      b = rect(pt(0.5, 0.5), pt(1.5, 1.5))
      assert rectintersect(a, b) == 0.25
      assert rectintersect(a, b, norm_intersect_area="a") == 0.25
      assert rectintersect(a, b, norm_intersect_area="b") == 0.25
      b = rect(pt(0.75, 0.5), pt(1.5, 1.5))
      assert rectintersect(a, b) == 0.125
  
      # touch
      a = rect(pt(0, 0), pt(1, 1))
      b = rect(pt(1, 1), pt(1.5, 1.5))
      assert rectintersect(a, b) == 0
  
      # no intersection
      a = rect(pt(0, 0), pt(1, 1))
      b = rect(pt(1.1, 1.1), pt(1.5, 1.5))
      assert rectintersect(a, b) is None
  
imports: import math
  import pytest
  from hypothesis import given
  import hypothesis.strategies
  import numpy
  from pdftabextract.geom import pt, ptdist, vecangle, vecrotate, overlap, lineintersect, rect, rectcenter, rectarea, rectintersect, normalize_angle, normalize_angle_halfcircle, project_polarcoord_lines
label_desc: Use image node_id 11 for calling a global function with example usage: test_rectintersect() without return types