code: def test_to_dict_is_accurate():
      train = lynx[:90]
      modl = auto_arima(
          train,
          start_p=1,
          start_q=1,
          start_P=1,
          start_Q=1,
          max_p=5,
          max_q=5,
          max_P=5,
          max_Q=5,
          seasonal=True,
          stepwise=True,
          suppress_warnings=True,
          D=10,
          max_D=10,
          error_action="ignore",
      )
      expected = {
          "pvalues": np.array(
              [
                  2.04752445e-03,
                  1.43710465e-61,
                  1.29504002e-10,
                  5.22119887e-15,
              ]
          ),
          "resid": np.array(
              [
                  -1244.3973072,
                  -302.89697033,
                  -317.63342593,
                  -304.57267897,
                  131.69413491,
                  956.15566697,
                  880.37459722,
                  2445.86460353,
                  -192.84268876,
                  -177.1932523,
                  -101.67727903,
                  384.05487582,
                  -304.52047818,
                  -570.72748088,
                  -497.48574217,
                  1286.86848903,
                  -400.22840217,
                  1017.55518758,
                  -1157.37024626,
                  -295.26213543,
                  104.79931827,
                  -574.9867485,
                  -588.49652697,
                  -535.37707505,
                  -355.71298419,
                  -164.06179682,
                  574.51900799,
                  15.45522718,
                  -1358.43416826,
                  120.42735893,
                  -147.94038284,
                  -685.64124874,
                  -365.18947057,
                  -243.79704985,
                  317.79437422,
                  585.59553667,
                  34.70605783,
                  -216.21587989,
                  -692.53375089,
                  116.87379358,
                  -385.52193301,
                  -540.95554558,
                  -283.16913167,
                  438.72324376,
                  1078.63542578,
                  3198.50449405,
                  -2167.76083646,
                  -783.80525821,
                  1384.85947061,
                  -95.84379882,
                  -728.85293118,
                  -35.68476597,
                  211.33538732,
                  -379.91950618,
                  599.42290213,
                  -839.30599392,
                  -201.97018962,
                  -393.28468589,
                  -376.16010796,
                  -516.52280993,
                  -369.25037143,
                  -362.25159504,
                  783.17714317,
                  207.96692746,
                  1744.27617969,
                  -1573.37293342,
                  -479.20751405,
                  473.18948601,
                  -503.20223823,
                  -648.62384466,
                  -671.12469446,
                  -547.51554005,
                  -501.37768686,
                  274.76714385,
                  2073.1897026,
                  -1063.19580729,
                  -1664.39957997,
                  882.73400004,
                  -304.17429193,
                  -422.60267409,
                  -292.34984241,
                  -27.76090888,
                  1724.60937822,
                  3095.90133612,
                  -325.78549678,
                  110.95150845,
                  645.21273504,
                  -135.91225092,
                  417.12710097,
                  -118.27553718,
              ]
          ),
          "order": (2, 0, 0),
          "seasonal_order": (0, 0, 0, 0),
          "oob": np.nan,
          "aic": 1487.8850037609368,
          "aicc": 1488.3555919962284,
          "bic": 1497.8842424422578,
          "bse": np.array(
              [
                  2.26237893e02,
                  6.97744631e-02,
                  9.58556537e-02,
                  1.03225425e05,
              ]
          ),
          "params": np.array(
              [
                  6.97548186e02,
                  1.15522102e00,
                  -6.16136459e-01,
                  8.07374077e05,
              ]
          ),
      }
  
      actual = modl.to_dict()
  
      assert actual.keys() == expected.keys()
      assert_almost_equal(
          actual["pvalues"], expected["pvalues"], decimal=5
      )
      assert_allclose(actual["resid"], expected["resid"], rtol=1e-3)
      assert actual["order"] == expected["order"]
      assert actual["seasonal_order"] == expected["seasonal_order"]
      assert np.isnan(actual["oob"])
      assert_almost_equal(actual["aic"], expected["aic"], decimal=5)
      assert_almost_equal(actual["aicc"], expected["aicc"], decimal=5)
      assert_almost_equal(actual["bic"], expected["bic"], decimal=5)
      assert_allclose(actual["bse"], expected["bse"], rtol=1e-3)
      assert_almost_equal(
          actual["params"], expected["params"], decimal=3
      )
  
imports: import numpy
  import pandas
  from pmdarima.arima import ARIMA, auto_arima, AutoARIMA, ARMAtoMA
  from pmdarima.arima import _validation
  from pmdarima.compat.pytest import pytest_error_str
  from pmdarima.datasets import load_lynx, load_wineind, load_heartrate
  from numpy.random import RandomState
  from numpy.testing import assert_array_almost_equal, assert_almost_equal, assert_allclose
  from statsmodels import api
  from sklearn.metrics import mean_squared_error
  import datetime
  import joblib
  import os
  import pickle
  import pytest
  import tempfile
  import time
label_desc: Use image node_id 21 for calling a global function with example usage: test_to_dict_is_accurate() without return types