code: def naiveDistanceProfile(tsA, idx, m, tsB=None):
      """
      Returns the distance profile of a query within tsA against the time series tsB using the naive all-pairs comparison.
  
      Parameters
      ----------
      tsA: Time series containing the query for which to calculate the distance profile.
      idx: Starting location of the query within tsA
      m: Length of query.
      tsB: Time series to compare the query against. Note that, if no value is provided, tsB = tsA by default.
      """
  
      selfJoin = False
      if tsB is None:
          selfJoin = True
          tsB = tsA
  
      query = tsA[idx : (idx + m)]
      distanceProfile = []
      n = len(tsB)
  
      for i in range(n - m + 1):
          distanceProfile.append(
              zNormalizeEuclidian(query, tsB[i : i + m])
          )
  
      dp = np.array(distanceProfile)
  
      if selfJoin:
          trivialMatchRange = (
              int(max(0, idx - np.round(m / 2, 0))),
              int(min(idx + np.round(m / 2 + 1, 0), n)),
          )
  
          dp[trivialMatchRange[0] : trivialMatchRange[1]] = np.inf
  
      return (dp, np.full(n - m + 1, idx, dtype=float))
  
file_path: matrixprofile-ts/matrixprofile/distanceProfile.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from .utils import *
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: naiveDistanceProfile(tsA, idx, m, tsB) and returns: dp,  np