code: def check_endog(endog, nobs=2, k_endog=1, **kwargs):
      # create the model
      mod = MLEModel(endog, **kwargs)
      # the data directly available in the model is the statsmodels version of
      # the data; it should be 2-dim, C-contiguous, long-shaped:
      # (nobs, k_endog) == (2, 1)
      assert_equal(mod.endog.ndim, 2)
      assert_equal(mod.endog.flags["C_CONTIGUOUS"], True)
      assert_equal(mod.endog.shape, (nobs, k_endog))
      # the data in the `ssm` object is the state space version of the data; it
      # should be 2-dim, F-contiguous, wide-shaped (k_endog, nobs) == (1, 2)
      # and it should share data with mod.endog
      assert_equal(mod.ssm.endog.ndim, 2)
      assert_equal(mod.ssm.endog.flags["F_CONTIGUOUS"], True)
      assert_equal(mod.ssm.endog.shape, (k_endog, nobs))
      assert_equal(mod.ssm.endog.base is mod.endog, True)
  
      return mod
  
imports: from statsmodels.compat.pandas import MONTH_END
  import os
  import re
  import warnings
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.datasets import nile
  from statsmodels.tsa.statespace import kalman_filter, kalman_smoother, sarimax, varmax
  from statsmodels.tsa.statespace.mlemodel import MLEModel, MLEResultsWrapper
  from statsmodels.tsa.statespace.tests.results import results_sarimax, results_var_misc
label_desc: Use image node_id 18 for calling a global function with example usage: check_endog(endog, nobs, k_endog) and returns: mod