code: def apply_av(mp, av=[1.0]):
      """
      Applies an annotation vector to a Matrix Profile.
  
      Parameters
      ----------
      mp: Tuple containing the Matrix Profile and Matrix Profile Index.
      av: Numpy array containing the annotation vector.
      """
  
      if len(mp[0]) != len(av):
          raise ValueError(
              "Annotation Vector must be the same length as the matrix profile"
          )
      else:
          av_max = np.max(av)
          av_min = np.min(av)
          if av_max > 1 or av_min < 0:
              raise ValueError(
                  "Annotation Vector must be between 0 and 1"
              )
          mp_corrected = mp[0] + (1 - np.array(av)) * np.max(mp[0])
          return (mp_corrected, mp[1])
  
file_path: matrixprofile-ts/matrixprofile/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import numpy.fft
label_desc: Use image node_id 9 for calling a global function with example usage: apply_av(mp, av) and returns: mp_corrected,  mp