code: def test_basic_endog():
      # Test various types of basic python endog inputs (e.g. lists, scalars...)
  
      # Check cannot call with non-array_like
      # fails due to checks in statsmodels base classes
      assert_raises(ValueError, MLEModel, endog=1, k_states=1)
      assert_raises(ValueError, MLEModel, endog="a", k_states=1)
      assert_raises(ValueError, MLEModel, endog=True, k_states=1)
  
      # Check behavior with different types
      mod = MLEModel([1], **kwargs)
      res = mod.filter([])
      assert_equal(res.filter_results.endog, [[1]])
  
      mod = MLEModel([1.0], **kwargs)
      res = mod.filter([])
      assert_equal(res.filter_results.endog, [[1]])
  
      mod = MLEModel([True], **kwargs)
      res = mod.filter([])
      assert_equal(res.filter_results.endog, [[1]])
  
      mod = MLEModel(["a"], **kwargs)
      # raises error due to inability coerce string to numeric
      assert_raises(ValueError, mod.filter, [])
  
      # Check that a different iterable tpyes give the expected result
      endog = [1.0, 2.0]
      mod = check_endog(endog, **kwargs)
      mod.filter([])
  
      endog = [[1.0], [2.0]]
      mod = check_endog(endog, **kwargs)
      mod.filter([])
  
      endog = (1.0, 2.0)
      mod = check_endog(endog, **kwargs)
      mod.filter([])
  
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 19 for calling a global function with example usage: test_basic_endog() without return types