def METHOD_NAME(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