code: def checkColumnNamesTypesReturned(
      training_data, model, x_indices, y_index=0
  ):
      unsupervised = (
          ("glrm" in model.algo)
          or ("pca" in model.algo)
          or ("kmeans" in model.algo)
      )
      trainNames = []
      if unsupervised:
          model.train(
              x=x_indices,
              training_frame=training_data,
              max_runtime_secs=1,
          )
          trainNames = x_indices
      else:
          if "word2vec" in model.algo:
              model.train(
                  training_frame=training_data, max_runtime_secs=1
              )
          else:
              model.train(
                  x=x_indices,
                  y=y_index,
                  training_frame=training_data,
                  max_runtime_secs=1,
              )
              trainNames = x_indices + [y_index]
      trainTypes = training_data.types
  
      pyunit_utils.assertModelColNamesTypesCorrect(
          model._model_json["output"]["names"],
          model._model_json["output"]["column_types"],
          trainNames,
          trainTypes,
      )
  
file_path: h2o-3/h2o-py/tests/testdir_jira/pyunit_pubdev_5801_add_names_types_model.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.deeplearning import H2ODeepLearningEstimator
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
  from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
  from h2o.estimators.kmeans import H2OKMeansEstimator
  from h2o.estimators.pca import H2OPrincipalComponentAnalysisEstimator
  from h2o.estimators.random_forest import H2ORandomForestEstimator
  from h2o.estimators.word2vec import H2OWord2vecEstimator
  from h2o.estimators.naive_bayes import H2ONaiveBayesEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: checkColumnNamesTypesReturned(training_data, model, x_indices, y_index) without return types