code: def test_lineintersect():
      # first with check_in_segm = True
      X = lineintersect(
          pt(0, 0), pt(0, 0), pt(0, 0), pt(0, 0)
      )  # coincident I
      assert sum(np.isnan(X)) == len(X)
  
      X = lineintersect(
          pt(0, 0), pt(0, 1), pt(0, 0), pt(0, 1)
      )  # coincident II
      assert sum(np.isnan(X)) == len(X)
  
      assert (
          lineintersect(pt(0, 0), pt(0, 1), pt(1, 0), pt(1, 1)) is None
      )  # parallel, non coincident
      assert (
          lineintersect(pt(0, 0), pt(0, 1), pt(1, 1), pt(2, 2)) is None
      )  # non-parellel, no intersection
      assert (
          lineintersect(pt(0, 0), pt(2, 2), pt(0, 5), pt(5, 0)) is None
      )  # non-parellel, no intersection II
      assert np.array_equal(
          lineintersect(pt(0, 0), pt(0, 1), pt(0, 1), pt(2, 2)),
          pt(0, 1),
      )  # intersection - touch
      assert np.array_equal(
          lineintersect(pt(0, 0), pt(2, 2), pt(0, 2), pt(2, 0)),
          pt(1, 1),
      )  # intersection
  
      # now with check_in_segm = False
      X = lineintersect(
          pt(0, 0), pt(0, 0), pt(0, 0), pt(0, 0), False
      )  # coincident I
      assert sum(np.isnan(X)) == len(X)
  
      X = lineintersect(
          pt(0, 0), pt(0, 1), pt(0, 0), pt(0, 1), False
      )  # coincident II
      assert sum(np.isnan(X)) == len(X)
  
      X = lineintersect(
          pt(0, 0), pt(1, 1), pt(2, 2), pt(3, 3), False
      )  # coincident III
      assert sum(np.isnan(X)) == len(X)
  
      assert np.array_equal(
          lineintersect(pt(0, 0), pt(0, 1), pt(1, 1), pt(2, 2), False),
          pt(0, 0),
      )  # intersection (out of segments)
      assert np.array_equal(
          lineintersect(pt(0, 0), pt(0, 1), pt(0, 1), pt(2, 2), False),
          pt(0, 1),
      )  # intersection - touch
      assert np.array_equal(
          lineintersect(pt(0, 0), pt(2, 2), pt(0, 2), pt(2, 0), False),
          pt(1, 1),
      )
  
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 7 for calling a global function with example usage: test_lineintersect() without return types