code: def test_warn_for_D(d, D, expected):
      if expected:
          with pytest.warns(ModelFitWarning) as mfw:
              val.warn_for_D(d=d, D=D)
  
              warning_msgs = pytest_warning_messages(mfw)
              assert any(expected in w for w in warning_msgs)
  
      else:
          with pytest.warns(None):
              val.warn_for_D(d=d, D=D)
  
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 8 for calling a global function with example usage: test_warn_for_D(d, D, expected) without return types