code: def test_fit_vs_R(setup_model, reset_randomstate):
      model, params, results_R = setup_model
  
      if PLATFORM_WIN and model.short_name == "AAdA":
          start = params
      else:
          start = None
      fit = model.fit(disp=True, pgtol=1e-8, start_params=start)
  
      # check log likelihood: we want to have a fit that is better, i.e. a fit
      # that has a **higher** log-likelihood
      const = -model.nobs / 2 * (np.log(2 * np.pi / model.nobs) + 1)
      loglike_R = results_R["loglik"][0] + const
      loglike = fit.llf
      try:
          assert loglike >= loglike_R - 1e-4
      except AssertionError:
          fit = model.fit(disp=True, pgtol=1e-8, start_params=params)
          loglike = fit.llf
          try:
              assert loglike >= loglike_R - 1e-4
          except AssertionError:
              if PLATFORM_LINUX32:
                  # Linux32 often fails to produce the correct solution.
                  # Fixing this is low priority given the rareness of
                  # its application
                  pytest.xfail("Known to fail on 32-bit Linux")
              else:
                  raise
  
imports: from statsmodels.compat.pandas import QUARTER_END
  from statsmodels.compat.platform import PLATFORM_LINUX32, PLATFORM_WIN
  from itertools import product
  import json
  import pathlib
  import numpy
  from numpy.testing import assert_allclose, assert_almost_equal
  import pandas
  import pytest
  import scipy.stats
  from statsmodels.tsa.exponential_smoothing.ets import ETSModel
  import statsmodels.tsa.holtwinters
  import statsmodels.tsa.statespace.exponential_smoothing
label_desc: Use image node_id 21 for calling a global function with example usage: test_fit_vs_R(setup_model, reset_randomstate) without return types