code: def validate_feature_importance(
      feature_importance: pd.Series, features: list, eps: float = 0.001
  ) -> pd.Series:
      """Validate feature importance."""
      if not isinstance(feature_importance, pd.Series):
          raise DeepchecksValueError(
              "feature_importance must be given as a pandas.Series where the index is feature "
              "names and the value is the calculated importance"
          )
      if feature_importance.isnull().any():
          raise DeepchecksValueError(
              "feature_importance must not contain null values"
          )
      if (feature_importance < 0).any():
          raise DeepchecksValueError(
              "feature_importance must not contain negative values"
          )
      if sorted(feature_importance.index) != sorted(features):
          raise DeepchecksValueError(
              "feature_importance index must be the feature names"
          )
      if not 1 - eps < feature_importance.sum() < 1 + eps:
          warnings.warn(
              "feature_importance does not sum to 1. Normalizing to 1.",
              UserWarning,
          )
          feature_importance = (
              feature_importance / feature_importance.sum()
          )
      return feature_importance
  
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 8 for calling a global function with example usage: validate_feature_importance(feature_importance, features, eps) and returns: feature_importance