code: def test_calc_curdistance():
      ts = np.array([1, 2, 3, 4, 5, 6, 7, 8])
      m = 4
  
      # test index 2
      idx = 2
      profile_len = scrimp.calc_profile_len(len(ts), m)
      (
          X,
          n,
          sumx2,
          sumx,
          meanx,
          sigmax2,
          sigmax,
      ) = scrimp.fast_find_nn_pre(ts, m)
      curlastz = np.zeros(profile_len)
      curlastz = scrimp.calc_curlastz(
          ts, m, n, idx, profile_len, curlastz
      )
  
      curdistance = np.zeros(profile_len)
      curdistance = scrimp.calc_curdistance(
          curlastz, meanx, sigmax, idx, profile_len, m, curdistance
      )
  
      expected_result = np.array(
          [
              0,
              0,
              0.4215e-07,
              0.4215e-07,
              0.4215e-07,
          ]
      )
  
      np.testing.assert_almost_equal(curdistance, expected_result)
  
      # test index 3
      idx = 3
      curlastz = np.zeros(profile_len)
      curlastz = scrimp.calc_curlastz(
          ts, m, n, idx, profile_len, curlastz
      )
      curdistance = np.zeros(profile_len)
      curdistance = scrimp.calc_curdistance(
          curlastz, meanx, sigmax, idx, profile_len, m, curdistance
      )
  
      np.testing.assert_almost_equal(curdistance, expected_result)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import pytest
  import numpy
  import matrixprofile
  from matrixprofile import scrimp
label_desc: Use image node_id 29 for calling a global function with example usage: test_calc_curdistance() without return types