code: def _validate_models(models, clf):
      """Validates models input argument"""
      try:
          iter(models)
      except:
          raise TypeError("Input argument 'models' is not iterable.")
      if not (
          isinstance(models[0], tuple) or isinstance(models[0], list)
      ):
          models = [models]
      names, estimators, param_sets = zip(*models)
      _validate_names(clf, names)
      _validate_estimators(estimators)
      _validate_params(param_sets)
      return models
  
imports: import numbers
  import numpy
  from itertools import compress
  from scipy.sparse import issparse
  from sklearn.model_selection import ParameterGrid
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 4 for calling a global function with example usage: _validate_models(models, clf) and returns: models