code: def make_complexity_AV(ts, m):
      """
      returns a complexity annotation vector for timeseries ts with window m.
      The complexity of a window is the average absolute difference between consecutive data points.
      """
      diffs = np.diff(ts, append=0) ** 2
      diff_mean, diff_std = movmeanstd(diffs, m)
  
      complexity = np.sqrt(diff_mean)
      complexity = complexity - complexity.min()
      complexity = complexity / complexity.max()
      return complexity
  
file_path: matrixprofile-ts/matrixprofile/annotation_vector.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  from .utils import movmeanstd
label_desc: Use image node_id 1 for calling a global function with example usage: make_complexity_AV(ts, m) and returns: complexity