code: def _validate_names(cls, names):
      """Validates names"""
      if len(set(names)) != len(names):
          raise ValueError(
              "Names provided are not unique: "
              "{0!r}".format(list(names))
          )
      invalid_names = [
          name for name in names if not isinstance(name, str)
      ]
      if invalid_names:
          raise ValueError(
              "Estimator names must be strings: got "
              "{0!r}".format(invalid_names)
          )
      invalid_names = set(names).intersection(
          cls.get_params(deep=False)
      )
      if invalid_names:
          raise ValueError(
              "Estimator names conflict with constructor "
              "arguments: {0!r}".format(sorted(invalid_names))
          )
      invalid_names = [name for name in names if "__" in name]
      if invalid_names:
          raise ValueError(
              "Estimator names must not contain __: got "
              "{0!r}".format(invalid_names)
          )
  
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 7 for calling a global function with example usage: _validate_names(cls, names) without return types