code: def test_max_dur():
      # set arbitrarily low to guarantee will always pass after one iter
      with StepwiseContext(max_dur=0.5), pytest.warns(
          UserWarning
      ) as uw:
          auto_arima(lynx, stepwise=True)
          # assert that max_dur was reached
          assert any(
              str(w.message).startswith("early termination") 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 4 for calling a global function with example usage: test_max_dur() without return types