code: def calculate_cv_metrics(model, endog, metric, cv):
      cv_metric = model_selection.cross_val_score(
          model, endog, cv=cv, scoring=metric, verbose=0
      )
      return cv_metric[~np.isnan(cv_metric)].mean()
  
imports: import json
  import numpy
  from pmdarima import auto_arima, model_selection
  from pmdarima.datasets import load_wineind
  import mlflow
  from mlflow.models import infer_signature
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_cv_metrics(model, endog, metric, cv) and returns: cv_metric