code: def test_utility_methods():
      global t
      pts = np.array(
          [
              [0, 0],
              [1, 0],
              [2, 0],
              [3, 0],
              [1.5, 2],
              [1.5, -2],
          ]
      )
      edges = np.array(
          [
              [4, 5],  # edge cuts through triangle (1, 2, 4)
          ]
      )
  
      t = T(pts, edges)
      # skip initialization and just simulate being part-way through
      # triangulation
      for tri in [[0, 1, 4], [1, 2, 4], [2, 3, 4]]:
          t._add_tri(*tri)
  
      # find_cut_triangle
      assert t._find_cut_triangle((4, 5)) == (4, 1, 2)
  
      # orientation
      assert t._orientation((4, 5), 0) == 1
      assert t._orientation((4, 5), 1) == 1
      assert t._orientation((4, 5), 2) == -1
      assert t._orientation((4, 5), 3) == -1
      assert t._orientation((4, 5), 4) == 0
      assert t._orientation((4, 5), 5) == 0
  
      # adjacent_tri
      assert t._adjacent_tri((1, 4), 0) == (4, 1, 2)
      assert t._adjacent_tri((0, 4), 1) is None
      assert t._adjacent_tri((1, 4), (1, 4, 0)) == (4, 1, 2)
      assert t._adjacent_tri((0, 4), (1, 4, 0)) is None
      try:
          t._adjacent_tri((1, 4), 5)
      except RuntimeError:
          pass
      else:
          raise Exception("Expected RuntimeError.")
  
      # edges_intersect
      assert not t._edges_intersect((0, 1), (1, 2))
      assert not t._edges_intersect((0, 2), (1, 2))
      assert t._edges_intersect((4, 5), (1, 2))
  
      # is_constraining_edge
      assert t._is_constraining_edge((4, 5))
      assert t._is_constraining_edge((5, 4))
      assert not t._is_constraining_edge((3, 5))
      assert not t._is_constraining_edge((3, 2))
  
file_path: vispy/vispy/geometry/tests/test_triangulation.py
imports: import sys
  from unittest import SkipTest
  import numpy
  from numpy.testing import assert_array_almost_equal
  from vispy.testing import run_tests_if_main
  from vispy.geometry.triangulation import Triangulation
label_desc: Use image node_id 6 for calling a global function with example usage: test_utility_methods() without return types