code: def test_calc_dotproduct_end_idx():
      ts = np.array([1, 2, 3, 4, 5, 6, 7, 8])
      m = 4
  
      # test index 0
      idx = 0
      dp = np.array([50, 0, 0, 0, 0])
      endidx = 0
      idx_nn = 2
      idx_diff = 2
      val = scrimp.calc_dotproduct_end_idx(
          ts, dp, idx, m, endidx, idx_nn, idx_diff
      )
      expected_val = dp
  
      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 23 for calling a global function with example usage: test_calc_dotproduct_end_idx() without return types