code: def test_approx_ei_traj():
      segs = 100
      t = np.linspace(0, 1.75 * 2 * np.pi, segs)
      x = t
      y = 5 * np.sin(5 * t)
      z = np.zeros(x.shape)
      xyz = np.vstack((x, y, z)).T
  
      xyza = pf.approx_polygon_track(xyz)
      assert_equal(len(xyza), 27)
  
      # test repeated point
      track = np.array(
          [
              [1.0, 0.0, 0.0],
              [1.0, 0.0, 0.0],
              [3.0, 0.0, 0.0],
              [4.0, 0.0, 0.0],
          ]
      )
      xyza = pf.approx_polygon_track(track)
      assert_array_equal(
          xyza, np.array([[1.0, 0.0, 0.0], [4.0, 0.0, 0.0]])
      )
  
file_path: dipy/dipy/tracking/tests/test_distances.py
imports: import warnings
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_equal, assert_almost_equal, assert_array_equal
  from dipy.testing import assert_true
  from dipy.testing.decorators import set_random_number_generator
  from dipy.tracking import distances
  from dipy.tracking.streamline import set_number_of_points
  from dipy.data import get_fnames
  from dipy.io.streamline import load_tractogram
label_desc: Use image node_id 5 for calling a global function with example usage: test_approx_ei_traj() without return types