code: def calc_dotproduct_end_idx(ts, dp, idx, m, endidx, idx_nn, idx_diff):
      tmp_a = ts[idx + m : endidx + m]
      tmp_b = ts[idx_nn + m : endidx + m + idx_diff]
      tmp_c = ts[idx:endidx]
      tmp_d = ts[idx_nn : endidx + idx_diff]
      tmp_f = tmp_a * tmp_b - tmp_c * tmp_d
  
      dp[idx + 1 : endidx + 1] = dp[idx] + np.cumsum(tmp_f)
  
      return dp
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  import time
  import warnings
  import numpy
label_desc: Use image node_id 14 for calling a global function with example usage: calc_dotproduct_end_idx(ts, dp, idx, m, endidx, idx_nn, idx_diff) and returns: dp