code: def fit_and_predict(index, ts, horizon, freq, seasonality):
      x = ts["y"].values
      try:
          mod = auto_arima(
              x,
              m=seasonality,
              with_intercept=False,
              error_action="ignore",
          )
          forecast = mod.predict(horizon)
      except:
          forecast = random_walk_with_drift(x, horizon)
  
      forecast = pd.DataFrame(
          {
              "ds": np.arange(
                  ts["ds"].max() + 1, ts["ds"].max() + horizon + 1
              ),
              "ypred": forecast,
          }
      )
      forecast["unique_id"] = index
  
      return forecast[["unique_id", "ds", "ypred"]]
  
file_path: statsforecast/experiments/arima/src/pmdarima.py
imports: import time
  from copy import deepcopy
  from functools import partial
  from multiprocessing import Pool, cpu_count
  import fire
  import numpy
  import pandas
  from pmdarima.arima import auto_arima
  from statsforecast.models import random_walk_with_drift
  from src.data import get_data
label_desc: Use image node_id 1 for calling a global function with example usage: fit_and_predict(index, ts, horizon, freq, seasonality) and returns: forecast