code: def get_importance(
      name: str, feature_importances: pd.Series, ds: "tabular.Dataset"
  ) -> int:
      """Return importance based on feature importance or label/date/index first."""
      if name in feature_importances.keys():
          return feature_importances[name]
      elif ds.has_label() and name == ds.label_name:
          return 1
      elif name in [ds.datetime_name, ds.index_name]:
          return 1
      return 0
  
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 5 for calling a global function with example usage: get_importance(name, feature_importances, ds) and returns: int, feature_importances, int, int