code: def test_subsequent_contexts():
      # Force a very fast fit
      with StepwiseContext(max_dur=0.5), pytest.warns(UserWarning):
          auto_arima(lynx, stepwise=True)
  
      # Out of scope, should be EMPTY
      ctx = ContextStore.get_or_empty(ContextType.STEPWISE)
      assert ctx.get_type() is ContextType.EMPTY
  
      # Now show that we DON'T hit early termination by time here
      with StepwiseContext(max_steps=100), warnings.catch_warnings(
          record=True
      ) as uw:
          ctx = ContextStore.get_or_empty(ContextType.STEPWISE)
          assert ctx.get_type() is ContextType.STEPWISE
          assert ctx.max_dur is None
  
          auto_arima(lynx, stepwise=True)
          # assert that max_dur was NOT reached
          if uw:
              assert not 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 5 for calling a global function with example usage: test_subsequent_contexts() without return types