code: def window_func(var_1, var_2, window, func):
      """
      apply a function to the rolling window of 2 arrays
  
      :param var_1: (np.ndarray) variable 1
      :param var_2: (np.ndarray) variable 2
      :param window: (int) length of the rolling window
      :param func: (numpy function) function to apply on the rolling window on variable 2 (such as np.mean)
      :return: (np.ndarray, np.ndarray)  the rolling output with applied function
      """
      var_2_window = rolling_window(var_2, window)
      function_on_var2 = func(var_2_window, axis=-1)
      return var_1[window - 1 :], function_on_var2
  
file_path: stable-baselines/stable_baselines/results_plotter.py
imports: import numpy
  import matplotlib
  import matplotlib.pyplot
  from stable_baselines.bench.monitor import load_results
label_desc: Use image node_id 2 for calling a global function with example usage: window_func(var_1, var_2, window, func) and returns: var_1,  function_on_var2