code: def coerce_estimator_and_id(estimators, estimator_id=None):
      """Coerce estimators to a dict with estimator_id as key and estimator as value.
  
      Parameters
      ----------
      estimators : dict, list or BaseEstimator object
          Estimator to coerce to a dict.
      estimator_id : str, optional (default=None)
          Identifier for estimator. If none given then uses estimator's class name.
  
      Returns
      -------
      estimators : dict
          Dict with estimator_id as key and estimator as value.
      """
      _check_estimators_type(estimators)
      if isinstance(estimators, dict):
          return estimators
      elif isinstance(estimators, list):
          return {
              estimator.__class__.__name__: estimator
              for estimator in estimators
          }
      elif is_initalised_estimator(estimators):
          estimator_id = estimator_id or estimators.__class__.__name__
          return {estimator_id: estimators}
      else:
          raise TypeError(
              "estimator must be of a type a dict, list or an initialised "
              f"BaseEstimator object but received {type(estimators)} type."
          )
  
file_path: sktime/sktime/benchmarking/benchmarks.py
imports: from typing import Callable, Optional, Union
  import pandas
  from sktime.base import BaseEstimator
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 3 for calling a global function with example usage: coerce_estimator_and_id(estimators, estimator_id) and returns: estimators, unknown, dict