def handle_data_class_factory(endog, exog):
 if data_util._is_using_ndarray_type(endog, exog):
  klass = ModelData
 elif data_util._is_using_pandas(endog, exog):
  klass = PandasData
 elif data_util._is_using_patsy(endog, exog):
  klass = PatsyData
 elif data_util._is_using_ndarray(endog, exog):
  klass = ModelData
 else:
  raise ValueError(('unrecognized data structures: %s / %s' % (type(endog), type(exog))))
 return klass

def handle_data_class_factory ( endog , exog ) : if data_util . _is_using_ndarray_type ( endog , exog ) : klass = ModelData elif data_util . _is_using_pandas ( endog , exog ) : klass = PandasData elif data_util . _is_using_patsy ( endog , exog ) : klass = PatsyData elif data_util . _is_using_ndarray ( endog , exog ) : klass = ModelData else : raise ValueError ( ( 'unrecognized data structures: %s / %s' % ( type ( endog ) , type ( exog ) ) ) ) return klass
given inputs .