code: def _matrixProfile_stomp(
      tsA, m, orderClass, distanceProfileFunction, tsB=None
  ):
      order = orderClass(len(tsA) - m + 1)
      mp, mpIndex = _self_join_or_not_preprocess(tsA, tsB, m)
  
      if not is_array_like(tsB):
          tsB = tsA
  
      tsA = _clean_nan_inf(tsA)
      tsB = _clean_nan_inf(tsB)
  
      idx = order.next()
  
      # Get moving mean and standard deviation
      mean, std = movmeanstd(tsA, m)
  
      # Initialize code to set dot_prev to None for the first pass
      dp = None
  
      # Initialize dot_first to None for the first pass
      dot_first = None
  
      while idx != None:
          # Need to pass in the previous sliding dot product for subsequent distance profile calculations
          (
              distanceProfile,
              querySegmentsID,
          ), dot_prev = distanceProfileFunction(
              tsA, idx, m, tsB, dot_first, dp, mean, std
          )
  
          if idx == 0:
              dot_first = dot_prev
  
          # Check which of the indices have found a new minimum
          idsToUpdate = distanceProfile < mp
  
          # Update the Matrix Profile Index to indicate that the current index is the minimum location for the aforementioned indices
          mpIndex[idsToUpdate] = querySegmentsID[idsToUpdate]
  
          # Update the matrix profile to include the new minimum values (where appropriate)
          mp = np.minimum(mp, distanceProfile)
          idx = order.next()
  
          dp = dot_prev
      return (mp, mpIndex)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from .None import distanceProfile
  from .None import order
  from .utils import mass, movmeanstd
  import numpy
  import multiprocessing
  from functools import partial
  import math
  from .scrimp import scrimp_plus_plus
label_desc: Use image node_id 8 for calling a global function with example usage: _matrixProfile_stomp(tsA, m, orderClass, distanceProfileFunction, tsB) and returns: mp,  mpIndex