code: def get_plot_info(
      meth_curr_opt_vals,
      cum_costs,
      meth_costs,
      grid_pts,
      outlier_frac,
      init_opt_vals,
      num_experiments,
  ):
      """Generates means and standard deviation for the method's output"""
      outlier_low_idx = int(
          max(np.round(outlier_frac * num_experiments), 0)
      )
      outlier_high_idx = min(
          num_experiments,
          int(
              num_experiments - np.rint(outlier_frac * num_experiments)
          ),
      )
      # Manage potential outliers
      inlier_idx = 0
      if num_experiments > 1:
          inlier_idx = np.arange(outlier_low_idx, outlier_high_idx)
      num_grid_pts = len(grid_pts)
      grid_vals = np.zeros((num_experiments, num_grid_pts))
      # Iterate through each experiment
      for exp_iter in range(num_experiments):
          if cum_costs is None:
              curr_cum_costs = np.cumsum(meth_costs[exp_iter])
          else:
              curr_cum_costs = cum_costs[exp_iter]
          if init_opt_vals is not None:
              opt_vals = np.concatenate(
                  (
                      np.array([init_opt_vals[exp_iter]]),
                      np.squeeze(meth_curr_opt_vals[exp_iter]),
                  ),
                  axis=0,
              )
              curr_cum_costs = np.concatenate(
                  (np.array([0]), np.squeeze(curr_cum_costs)), axis=0
              )
          else:
              opt_vals = meth_curr_opt_vals[exp_iter]
          interp = np.interp(
              grid_pts, curr_cum_costs.flatten(), opt_vals.flatten()
          )
          grid_vals[exp_iter, :] = np.fmax.accumulate(interp)
      sorted_grid_vals = np.sort(grid_vals, axis=0)
      inlier_grid_vals = sorted_grid_vals[inlier_idx, :]
      if num_experiments == 1:
          inlier_grid_vals = np.expand_dims(inlier_grid_vals, axis=0)
  
      # An internal function to get mean and std
      def mean_and_std(arr1d):
          """Returns mean and standard deviation."""
          finite_arr1d = arr1d[np.isfinite(arr1d)]
          if finite_arr1d.size / arr1d.size >= 0.4:
              return np.array(
                  [
                      np.mean(finite_arr1d),
                      np.std(finite_arr1d) / np.sqrt(arr1d.size),
                  ]
              )
          return np.array([np.NaN] * 2)
  
      # Return
      res = np.apply_along_axis(mean_and_std, 0, inlier_grid_vals)
      return (res[0, :], res[1, :])
  
file_path: dragonfly/dragonfly/utils/plot_utils.py
imports: from __future__ import division
  import pickle
  import argparse
  import matplotlib.pyplot
  import matplotlib
  from scipy.io import loadmat
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: get_plot_info(meth_curr_opt_vals, cum_costs, meth_costs, grid_pts, outlier_frac, init_opt_vals, num_experiments) and returns: res,  res, np, np