code: def _predict_common(
      key,
      data,
      dtype,
      start,
      end,
      num_steps=None,
      level=None,
      simple_differencing=True,
  ):
      """Utility function used by test_predict and test_forecast to avoid
      code duplication.
      """
      order, seasonal_order, intercept = extract_order(key)
  
      (
          _,
          y_train_cudf,
          _,
          _,
          _,
          exog_cudf,
          exog_fut,
          exog_fut_cudf,
      ) = get_dataset(data, dtype)
  
      # Get fit reference model
      ref_fits = get_ref_fit(
          data, order, seasonal_order, intercept, dtype
      )
  
      # Create cuML model
      cuml_model = arima.ARIMA(
          endog=y_train_cudf,
          exog=exog_cudf,
          order=order,
          seasonal_order=seasonal_order,
          fit_intercept=intercept,
          output_type="numpy",
          simple_differencing=simple_differencing,
      )
  
      # Feed the parameters to the cuML model
      _statsmodels_to_cuml(
          ref_fits, cuml_model, order, seasonal_order, intercept, dtype
      )
  
      # Predict or forecast
      # Reference (statsmodels)
      ref_preds = np.zeros((end - start, data.batch_size))
      for i in range(data.batch_size):
          ref_preds[:, i] = (
              ref_fits[i]
              .get_prediction(
                  start,
                  end - 1,
                  exog=(
                      None
                      if data.n_exog == 0 or end <= data.n_train
                      else exog_fut[
                          exog_fut.columns[
                              data.n_exog * i : data.n_exog * (i + 1)
                          ]
                      ]
                  ),
              )
              .predicted_mean
          )
      if level is not None:
          ref_lower = np.zeros((end - start, data.batch_size))
          ref_upper = np.zeros((end - start, data.batch_size))
          for i in range(data.batch_size):
              temp_pred = ref_fits[i].get_forecast(
                  num_steps,
                  exog=(
                      None
                      if data.n_exog == 0
                      else exog_fut[
                          exog_fut.columns[
                              data.n_exog * i : data.n_exog * (i + 1)
                          ]
                      ]
                  ),
              )
              ci = temp_pred.summary_frame(alpha=1 - level)
              ref_lower[:, i] = ci["mean_ci_lower"].to_numpy()
              ref_upper[:, i] = ci["mean_ci_upper"].to_numpy()
      # cuML
      if num_steps is None:
          cuml_pred = cuml_model.predict(
              start,
              end,
              exog=None
              if data.n_exog == 0 or end <= data.n_train
              else exog_fut_cudf,
          )
      elif level is not None:
          cuml_pred, cuml_lower, cuml_upper = cuml_model.forecast(
              num_steps, level, exog=exog_fut_cudf
          )
      else:
          cuml_pred = cuml_model.forecast(num_steps, exog=exog_fut_cudf)
  
      # Compare results
      np.testing.assert_allclose(
          cuml_pred, ref_preds, rtol=0.002, atol=0.01
      )
      if level is not None:
          np.testing.assert_allclose(
              cuml_lower, ref_lower, rtol=0.005, atol=0.01
          )
          np.testing.assert_allclose(
              cuml_upper, ref_upper, rtol=0.005, atol=0.01
          )
  
imports: from cuml.testing.utils import stress_param
  from cuml.internals.input_utils import input_to_host_array
  import cuml.tsa.arima
  from cuml.internals.safe_imports import gpu_only_import
  import statsmodels.api
  from sklearn.model_selection import train_test_split
  from cuml.internals.safe_imports import cpu_only_import_from
  import warnings
  import os
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 8 for calling a global function with example usage: _predict_common(key, data, dtype, start, end, num_steps, level, simple_differencing) without return types