code: def test_auto_arima_with_stepwise_context():
      samp = lynx[:8]
      with StepwiseContext(max_steps=3, max_dur=30):
          with pytest.warns(UserWarning) as uw:
              auto_arima(
                  samp,
                  suppress_warnings=False,
                  stepwise=True,
                  error_action="ignore",
              )
  
              # assert that max_steps were taken
              assert any(
                  str(w.message).startswith(
                      "stepwise search has reached the "
                      "maximum number of tries"
                  )
                  for w in uw
              )
  
file_path: pmdarima/pmdarima/arima/tests/test_context.py
imports: from pmdarima.arima.auto import StepwiseContext, auto_arima
  from pmdarima.arima._context import ContextStore, ContextType
  from pmdarima.arima import _context
  from pmdarima.datasets import load_lynx, load_wineind
  from unittest import mock
  import threading
  import collections
  import pytest
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test_auto_arima_with_stepwise_context() without return types