code: def check_estimator(Estimator):
      """Check if estimator adheres to scikit-learn conventions.
      This estimator will run an extensive test-suite for input validation,
      shapes, etc.
      Additional tests for classifiers, regressors, clustering or transformers
      will be run if the Estimator class inherits from the corresponding mixin
      from sklearn.base.
      This test can be applied to classes or instances.
      Classes currently have some additional tests that related to construction,
      while passing instances allows the testing of multiple options.
      Parameters
      ----------
      estimator : estimator object or class
          Estimator to check. Estimator is a class object or instance.
      """
      if isinstance(Estimator, type):
          # got a class
          name = Estimator.__name__
          estimator = Estimator()
  
          check_parameters_default_constructible(name, estimator)
          check_no_attributes_set_in_init(name, estimator)
      else:
          # got an instance
          estimator = Estimator
          name = type(estimator).__name__
  
      if hasattr(estimator, "max_iter"):
          if isinstance(estimator, LearningShapelets):
              estimator.set_params(max_iter=100)
          else:
              estimator.set_params(max_iter=10)
      if hasattr(estimator, "total_lengths"):
          estimator.set_params(total_lengths=1)
      if hasattr(estimator, "probability"):
          estimator.set_params(probability=True)
  
      def checks_generator():
          for check in checks._yield_all_checks(name, estimator):
              check = _maybe_skip(estimator, check)
              yield estimator, partial(check, name)
  
      for estimator, check in checks_generator():
          try:
              check(estimator)
          except SkipTest as exception:
              # the only SkipTest thrown currently results from not
              # being able to import pandas.
              warnings.warn(str(exception), SkipTestWarning)
  
file_path: tslearn/tslearn/tests/test_estimators.py
imports: import tslearn
  import pkgutil
  import inspect
  from functools import partial
  from operator import itemgetter
  import sklearn
  from sklearn.base import BaseEstimator, ClassifierMixin, ClusterMixin, RegressorMixin, TransformerMixin
  from sklearn.exceptions import SkipTestWarning
  from sklearn.utils.estimator_checks import check_no_attributes_set_in_init, check_parameters_default_constructible, _maybe_skip
  from tslearn.tests.sklearn_patches import check_clustering, check_non_transf_est_n_iter, check_fit_idempotent, check_classifiers_classes, check_classifiers_train, check_estimators_pickle, check_supervised_y_2d, check_regressor_data_not_an_array, check_classifier_data_not_an_array, check_regressors_int_patched, check_classifiers_cont_target, check_pipeline_consistency, yield_all_checks, _create_large_ts_dataset
  from tslearn.shapelets import LearningShapelets
  import warnings
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: check_estimator(Estimator) without return types