code: def handle_data(endog, exog, missing="none", hasconst=None, **kwargs):
      # deal with lists and tuples up-front
      if isinstance(endog, (list, tuple)):
          endog = np.asarray(endog)
      if isinstance(exog, (list, tuple)):
          exog = np.asarray(exog)
  
      klass = handle_data_class_factory(endog, exog)
      return klass(
          endog, exog=exog, missing=missing, hasconst=hasconst, **kwargs
      )
  
imports: from __future__ import annotations
  from statsmodels.compat.python import lmap
  from functools import reduce
  import numpy
  from pandas import DataFrame, Series, isnull, MultiIndex
  import statsmodels.tools.data
  from statsmodels.tools.decorators import cache_readonly, cache_writable
  from statsmodels.tools.sm_exceptions import MissingDataError
label_desc: Use image node_id 8 for calling a global function with example usage: handle_data(endog, exog, missing, hasconst) and returns: klass