code: def check_is_fitted(estimator, attributes):
      """Ensure the model has been fitted
  
      Typically called at the beginning of an operation on a model that requires
      having been fit. Raises a ``NotFittedError`` if the model has not been
      fit.
  
      This is an adaptation of scikit-learn's ``check_is_fitted``, which has been
      changed recently in a way that is no longer compatible with our package.
  
      Parameters
      ----------
      estimator : estimator instance,
          The estimator that will be checked to see if it is fitted.
  
      attributes : str or iterable
          The attributes to check for
      """
      if isinstance(attributes, str):
          attributes = [attributes]
      if not hasattr(attributes, "__iter__"):
          raise TypeError("attributes must be a string or iterable")
      for attr in attributes:
          if hasattr(estimator, attr):
              return
      raise NotFittedError("Model has not been fit!")
  
imports: from packaging.version import Version
  import sklearn
  from sklearn.exceptions import NotFittedError
label_desc: Use image node_id 1 for calling a global function with example usage: check_is_fitted(estimator, attributes) without return types