code: def get_results_from_reconciled_df(reconciled_df, hierarchy_df):
      """Formats the reconciled df into a normal Nixtla results df.
  
      First drops the model output columns that haven't been reconciled.
      Then drops rows corresponding to higher level predictions that were not
      in the original dataframe, e.g. the total for each grouping.
      """
      #  Drop unnecessary columns
      for col in reconciled_df.columns:
          if col not in ["ds", "y"]:
              if "BottomUp" not in col:
                  results_df = reconciled_df.drop(
                      col, axis=1
                  )  # removes original forecast column
                  break
  
      #  Drop higher-level rows
      lowest_level_ids = hierarchy_df.columns
      results_df = results_df[results_df.index.isin(lowest_level_ids)]
      results_df.index = results_df.index.str.replace("total/", "")
      return results_df
  
file_path: mindsdb/mindsdb/integrations/utilities/time_series_utils.py
imports: import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  from sklearn.metrics import r2_score
  from mindsdb.utilities import log
label_desc: Use image node_id 9 for calling a global function with example usage: get_results_from_reconciled_df(reconciled_df, hierarchy_df) and returns: results_df