code: def ts2xy(timesteps, xaxis):
      """
      Decompose a timesteps variable to x ans ys
  
      :param timesteps: (Pandas DataFrame) the input data
      :param xaxis: (str) the axis for the x and y output
          (can be X_TIMESTEPS='timesteps', X_EPISODES='episodes' or X_WALLTIME='walltime_hrs')
      :return: (np.ndarray, np.ndarray) the x and y output
      """
      if xaxis == X_TIMESTEPS:
          x_var = np.cumsum(timesteps.l.values)
          y_var = timesteps.r.values
      elif xaxis == X_EPISODES:
          x_var = np.arange(len(timesteps))
          y_var = timesteps.r.values
      elif xaxis == X_WALLTIME:
          x_var = timesteps.t.values / 3600.0
          y_var = timesteps.r.values
      else:
          raise NotImplementedError
      return x_var, y_var
  
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 3 for calling a global function with example usage: ts2xy(timesteps, xaxis) and returns: x_var,  y_var