code: def easy_cross_validation(train, target, initial, horizon, period):
      n_folds = int(((train.shape[0] - initial) / period) - 1)
      y_preds = pd.DataFrame()
      print(
          "Max. iterations using sliding window cross validation = %d"
          % n_folds
      )
      start_time = time.time()
      start_p = 0  ## this represents start of train fold
      end_p = initial  ## this represents end of train fold
      start_s = initial  ## this represents start of test fold
      end_s = initial + horizon  ### this represents end of test fold
      rmse_means = []
      norm_rmse_means = []
      y_trues = pd.DataFrame()
      for i in range(n_folds):
          # start_p += i*period
          end_p += i * period
          train_fold = train[start_p:end_p]
          start_s += i * period
          end_s += i * period
          test_fold = train[start_s:end_s]
          if len(test_fold) == 0:
              break
          model = Prophet(growth="linear")
          kwargs = {
              "iter": 100
          }  ## this limits iterations and hence speeds up prophet
          model.fit(train_fold, **kwargs)
          future_period = model.make_future_dataframe(
              freq="MS", periods=horizon
          )
          forecast_df = model.predict(future_period)
          y_pred = forecast_df.iloc[start_s:end_s]["yhat"]
          if i == 0:
              y_preds = copy.deepcopy(y_pred)
          else:
              y_preds = y_preds.append(y_pred)
          rmse_fold, rmse_norm = print_dynamic_rmse(
              test_fold[target], y_pred, test_fold[target]
          )
          print("Cross Validation window: %d completed" % (i + 1,))
          rmse_means.append(rmse_fold)
          norm_rmse_means.append(rmse_norm)
      ### This is where you consolidate the CV results ####
      # print('Time Taken = %0.0f mins' %((time.time()-start_time)/60))
      rmse_mean = np.mean(rmse_means)
      # print('Average CV RMSE over %d windows (macro) = %0.5f' %(i,rmse_mean))
      y_trues = train[-y_preds.shape[0] :][target]
      cv_micro = np.sqrt(
          mean_squared_error(y_trues.values, y_preds.values)
      )
      # print('Average CV RMSE of all predictions (micro) = %0.5f' %cv_micro)
      try:
          quick_ts_plot(train[target], y_preds[-horizon:])
      except:
          print("Error: Not able to plot Prophet CV results")
      return y_trues, y_preds, rmse_means, norm_rmse_means
  
imports: from typing import Optional
  import logging
  import copy
  import time
  import numpy
  from sklearn.model_selection import TimeSeriesSplit
  import pandas
  from pandas.core.generic import NDFrame
  import pdb
  import dask
  import dask.dataframe
  import matplotlib.pyplot
  from prophet import Prophet
  from prophet.diagnostics import cross_validation
  from prophet.diagnostics import performance_metrics
  from prophet.plot import plot_cross_validation_metric
  from .build_base import BuildBase
  from ..utils import print_dynamic_rmse, quick_ts_plot, print_ts_model_stats
  from ..utils.logging import SuppressStdoutStderr
  from sklearn.metrics import mean_squared_error
  from prophet import Prophet
  import time
  import pdb
  import copy
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: easy_cross_validation(train, target, initial, horizon, period) and returns: y_trues,  y_preds,  rmse_means,  norm_rmse_means