code: def test_hierarchy_ensemble_node_predict(forecasters):
      """Check the node predictions."""
      agg = Aggregator()
  
      y = _bottom_hier_datagen(
          no_bottom_nodes=7,
          no_levels=2,
          random_seed=123,
      )
  
      forecaster = HierarchyEnsembleForecaster(
          forecasters, by="node", default=forecasters[0][1].clone()
      )
  
      forecaster.fit(y, fh=[1, 2, 3])
      actual_pred = forecaster.predict()
  
      y = agg.fit_transform(y)
  
      for i in range(len(forecasters)):
          test_frcstr = forecasters[i][1].clone()
          df = y[
              y.index.droplevel(-1).isin(forecaster.fitted_list[i][1])
          ]
          test_frcstr.fit(df, fh=[1, 2, 3])
          test_pred = test_frcstr.predict()
          msg = "Node predictions do not match"
          assert np.all(
              actual_pred.loc[test_pred.index] == test_pred
          ), msg
  
      def_frcstr = forecasters[0][1].clone()
      df = y[y.index.droplevel(-1).isin(forecaster.fitted_list[-1][1])]
      def_frcstr.fit(df, fh=[1, 2, 3])
      def_pred = def_frcstr.predict()
      msg = "Node default predictions do not match"
      assert np.all(actual_pred.loc[def_pred.index] == def_pred), msg
  
file_path: sktime/sktime/forecasting/compose/tests/test_hierarchy_ensemble.py
imports: import numpy
  import pytest
  from sktime.base._meta import flatten
  from sktime.datatypes._utilities import get_window
  from sktime.forecasting.compose import HierarchyEnsembleForecaster
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.trend import PolynomialTrendForecaster, TrendForecaster
  from sktime.transformations.hierarchical.aggregate import Aggregator
  from sktime.utils._testing.hierarchical import _bottom_hier_datagen, _make_hierarchical
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 2 for calling a global function with example usage: test_hierarchy_ensemble_node_predict(forecasters) without return types