code: def test_with_oob():
      # show we can fit with CV (kinda)
      arima = ARIMA(
          order=(2, 1, 2),
          suppress_warnings=True,
          scoring="mse",
          out_of_sample_size=10,
      ).fit(y=hr)
  
      oob = arima.oob()
      assert not np.isnan(oob)  # show this works
  
      # Assert the predictions give the expected MAE/MSE
      oob_preds = arima.oob_preds_
      assert oob_preds.shape[0] == 10
      scoring = val.get_scoring_metric("mse")
      assert scoring(hr[-10:], oob_preds) == oob
  
      # show we can fit if ooss < 0 and oob will be nan
      arima = ARIMA(
          order=(2, 1, 2), suppress_warnings=True, out_of_sample_size=-1
      ).fit(y=hr)
      assert np.isnan(arima.oob())
  
      # This will raise since n_steps is not an int
      with pytest.raises(TypeError):
          arima.predict(n_periods="5")
  
      # But that we CAN forecast with an int...
      _ = arima.predict(n_periods=5)  # noqa: F841
  
      # Show we fail if cv > n_samples
      with pytest.raises(ValueError):
          ARIMA(order=(2, 1, 2), out_of_sample_size=1000).fit(hr)
  
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 9 for calling a global function with example usage: test_with_oob() without return types