code: def _assert_correct_columns(y_pred, y_train):
      """Check that forecast object has right column names."""
      if isinstance(y_pred, pd.DataFrame) and isinstance(
          y_train, pd.DataFrame
      ):
          msg = (
              "forecast pd.DataFrame must have same column index as past data, "
              f"expected {y_train.columns} but found {y_pred.columns}"
          )
          assert (y_pred.columns == y_train.columns).all(), msg
  
      if isinstance(y_pred, pd.Series) and isinstance(
          y_train, pd.Series
      ):
          msg = (
              "forecast pd.Series must have same name as past data, "
              f"expected {y_train.name} but found {y_pred.name}"
          )
          assert y_pred.name == y_train.name, msg
  
file_path: sktime/sktime/utils/_testing/forecasting.py
imports: import numpy
  import pandas
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.utils._testing.series import _make_series
  from sktime.utils.validation.forecasting import check_fh
label_desc: Use image node_id 6 for calling a global function with example usage: _assert_correct_columns(y_pred, y_train) without return types