code: def test_loglike_vs_R(setup_model):
      model, params, results_R = setup_model
  
      loglike = model.loglike(params)
      # the calculation of log likelihood in R is only up to a constant:
      const = -model.nobs / 2 * (np.log(2 * np.pi / model.nobs) + 1)
      loglike_R = results_R["loglik"][0] + const
  
      assert_allclose(loglike, loglike_R, rtol=1e-5, atol=1e-5)
  
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 18 for calling a global function with example usage: test_loglike_vs_R(setup_model) without return types