code: def downsample(vector, factor):
      """
      downsample(vector, factor):
          Downsample (by averaging) a vector by an integer factor.
      """
      if len(vector) % factor:
          print(
              "Length of 'vector' is not divisible by 'factor'=%d!"
              % factor
          )
          return 0
      vector.shape = (len(vector) / factor, factor)
      return numpy.mean(vector, axis=1)
  
file_path: TimeSide/timeside/plugins/grapher/utils.py
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: downsample(vector, factor) and returns: numpy, int