code: def test_calc_dotproduct_idx():
      ts = [1, 2, 3, 4, 5, 6, 7, 8]
      m = 4
  
      # test index 0
      idx = 0
      profile_len = scrimp.calc_profile_len(len(ts), m)
      exclusion_zone = scrimp.calc_exclusion_zone(m)
      subsequence = scrimp.next_subsequence(ts, idx, m)
      (
          X,
          n,
          sumx2,
          sumx,
          meanx,
          sigmax2,
          sigmax,
      ) = scrimp.fast_find_nn_pre(ts, m)
      dp = scrimp.calc_distance_profile(
          X, subsequence, n, m, meanx, sigmax
      )
      dp = scrimp.apply_exclusion_zone(
          idx, exclusion_zone, profile_len, dp
      )
      mp = np.zeros(profile_len)
      mp_index = np.zeros(profile_len, dtype="int32")
      mp, mp_index, idx_nn = scrimp.find_and_store_nn(
          0, idx, mp, mp_index, dp
      )
      dotproduct = np.zeros(profile_len)
      val = scrimp.calc_dotproduct_idx(
          dotproduct, m, mp, idx, sigmax, idx_nn, meanx
      )
      expected_val = np.array([50, 0, 0, 0, 0])
  
      np.testing.assert_almost_equal(val, expected_val)
  
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 21 for calling a global function with example usage: test_calc_dotproduct_idx() without return types