code: def column_importance_sorter_dict(
      cols_dict: t.Dict[Hashable, t.Any],
      dataset: "tabular.Dataset",
      feature_importances: t.Optional[pd.Series] = None,
      n_top: int = 10,
  ) -> t.Dict:
      """Return the dict of columns sorted and limited by feature importance.
  
      Parameters
      ----------
      cols_dict : t.Dict[Hashable, t.Any]
          dict where columns are the keys
      dataset : tabular.Dataset
          dataset used to fit the model
      feature_importances : t.Optional[pd.Series] , default: None
          feature importance normalized to 0-1 indexed by feature names
      n_top : int , default: 10
          amount of columns to show ordered by feature importance (date, index, label are first)
  
      Returns
      -------
      Dict
          the dict of columns sorted and limited by feature importance.
      """
      feature_importances = (
          {} if feature_importances is None else feature_importances
      )
  
      def key(name):
          return get_importance(name[0], feature_importances, dataset)
  
      cols_dict = dict(sorted(cols_dict.items(), key=key, reverse=True))
      if n_top:
          return dict(list(cols_dict.items())[:n_top])
      return cols_dict
  
imports: import time
  import typing
  import warnings
  import numpy
  import pandas
  from sklearn.inspection import permutation_importance
  from sklearn.pipeline import Pipeline
  from deepchecks import tabular
  from deepchecks.core import errors
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.tabular.metric_utils.scorers import DeepcheckScorer, get_default_scorers, init_validate_scorers
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.tabular.utils.validation import validate_model
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 6 for calling a global function with example usage: column_importance_sorter_dict(cols_dict, dataset, feature_importances, n_top) and returns: cols_dict, get_importance, dict