code: def util_granulate_time_series(time_series, scale):
      
      n = len(time_series)
      b = int(np.fix(n / scale))
      temp = np.reshape(time_series[0:b*scale], (b, scale))
      cts = np.mean(temp, axis = 1)
      return cts
docs: Extract coarse-grained time series
  
      Args:
          time_series: Time series
          scale: Scale factor
  
      Returns:
          Vector of coarse-grained time series with given scale factor