code: def create_metricframe_w_errors(
      mframe, metrics_to_report, metric_error_pair
  ):
      mframe_by_group = mframe.by_group.copy()
      for metric_name, error_name in metric_error_pair:
          mframe_by_group[metric_name] = mframe_by_group[
              metric_name
          ].apply(lambda x: f"{x:.3f}")
          mframe_by_group[error_name] = mframe_by_group[
              error_name
          ].apply(lambda x: f"{x:.3f}")
          mframe_by_group[metric_name] = mframe_by_group[
              metric_name
          ].str.cat(mframe_by_group[error_name], sep="±")
      return mframe_by_group[metrics_to_report]
  
imports: import numpy
  import pandas
  import matplotlib.pyplot
  import lightgbm
  from sklearn.metrics import balanced_accuracy_score, roc_auc_score
  from sklearn.metrics import confusion_matrix
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from fairlearn.metrics import MetricFrame
  from fairlearn.metrics import count, selection_rate, equalized_odds_difference, false_positive_rate, false_negative_rate
  from fairlearn.postprocessing import ThresholdOptimizer
  from fairlearn.reductions import ExponentiatedGradient
  from fairlearn.reductions import EqualizedOdds
  from sklearn.model_selection import train_test_split
  import warnings
label_desc: Use image node_id 14 for calling a global function with example usage: create_metricframe_w_errors(mframe, metrics_to_report, metric_error_pair) and returns: mframe_by_group