code: def test_get_hierarchy_from_df():
      df = pd.DataFrame(
          {"col1": [1, 2], "col2": [3, 4], "target": [5, 6]}
      )
      df["time_col"] = pd.date_range(
          start="1/1/2010", freq="M", periods=2
      )
      model_args = {
          "order_by": "time_col",
          "group_by": ["col1", "col2"],
          "target": "target",
          "hierarchy": ["col1", "col2"],
      }
  
      training_df, hier_df, hier_dict = get_hierarchy_from_df(
          df, model_args
      )
      assert training_df.columns.tolist() == ["ds", "y"]
      assert training_df.index.name == "unique_id"
      # checks shape of hierarchy matrix, which is a [0, 1] matrix
      assert hier_df.columns.tolist() == ["total/1/3", "total/2/4"]
      assert hier_df.index.tolist() == [
          "total",
          "total/1",
          "total/2",
          "total/1/3",
          "total/2/4",
      ]
  
      assert hier_dict["Total"].tolist() == ["total"]
      assert hier_dict["Total/col1"].tolist() == ["total/1", "total/2"]
      assert hier_dict["Total/col1/col2"] == ["total/1/3", "total/2/4"]
  
file_path: mindsdb/tests/unit/ml_handlers/test_time_series_utils.py
imports: import pandas
  from statsforecast.utils import AirPassengersDF
  from mindsdb.integrations.utilities.time_series_utils import transform_to_nixtla_df, get_results_from_nixtla_df, infer_frequency, get_best_model_from_results_df, spec_hierarchy_from_list, get_hierarchy_from_df, reconcile_forecasts
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_hierarchy_from_df() without return types