code: def test_check_n_jobs(
      stepwise, n_jobs, expect_warning, expected_n_jobs
  ):
      if expect_warning:
          with pytest.warns(UserWarning) as w:
              res = val.check_n_jobs(stepwise, n_jobs)
          assert any(
              "stepwise model cannot be fit in parallel" in s
              for s in pytest_warning_messages(w)
          )
      else:
          with pytest.warns(None) as w:
              res = val.check_n_jobs(stepwise, n_jobs)
          assert not w
  
      assert expected_n_jobs == res
  
file_path: pmdarima/pmdarima/arima/tests/test_validation.py
imports: import numpy
  import pytest
  from pmdarima.compat.pytest import pytest_warning_messages, pytest_error_str
  from pmdarima.arima import _validation
  from pmdarima.warnings import ModelFitWarning
label_desc: Use image node_id 4 for calling a global function with example usage: test_check_n_jobs(stepwise, n_jobs, expect_warning, expected_n_jobs) without return types