code: def check_fitted(results):
      import pytest
  
      # ignore wrapper for isinstance check
      from statsmodels.genmod.generalized_linear_model import GLMResults
      from statsmodels.discrete.discrete_model import DiscreteResults
  
      # possibly unwrap -- GEE has no wrapper
      results = getattr(results, "_results", results)
  
      if isinstance(results, (GLMResults, DiscreteResults)):
          pytest.skip(f"Not supported for {type(results)}")
  
      res = results
      fitted = res.fittedvalues
      assert_allclose(res.model.endog - fitted, res.resid, rtol=1e-12)
      assert_allclose(fitted, res.predict(), rtol=1e-12)
  
file_path: statsmodels/statsmodels/tools/_testing.py
imports: import os
  import sys
  from packaging.version import Version, parse
  import numpy
  from numpy.testing import assert_allclose, assert_
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: check_fitted(results) without return types