code: def test_calculate_importance_when_model_is_pipeline(
      iris_labeled_dataset, caplog
  ):
      # Arrange
      clf = Pipeline(
          [
              (
                  "model",
                  MLPClassifier(
                      hidden_layer_sizes=(10,), random_state=42
                  ),
              )
          ]
      )
      clf.fit(
          iris_labeled_dataset.data[iris_labeled_dataset.features],
          iris_labeled_dataset.data[iris_labeled_dataset.label_name],
      )
  
      # Act
      feature_importances, fi_type = run_fi_calculation(
          clf, iris_labeled_dataset, permutation_kwargs={"timeout": 120}
      )
      assert_that(caplog.records, has_length(1))
      assert_that(
          caplog.records[0].message,
          equal_to(
              "Cannot use model's built-in feature importance on a Scikit-learn "
              "Pipeline, using permutation feature importance calculation instead"
          ),
      )
  
      # Assert
      assert_that(feature_importances.sum(), close_to(1, 0.000001))
      assert_that(fi_type, is_("permutation_importance"))
  
imports: import pandas
  import pytest
  from hamcrest import any_of, assert_that, calling, close_to, contains_exactly, contains_string, equal_to, has_length, is_, none, not_none, raises
  from sklearn.ensemble import AdaBoostClassifier
  from sklearn.linear_model import LinearRegression, LogisticRegression
  from sklearn.neural_network import MLPClassifier, MLPRegressor
  from sklearn.pipeline import Pipeline
  from deepchecks.core.errors import DeepchecksTimeoutError, DeepchecksValueError, ModelValidationError
  from deepchecks.tabular.dataset import Dataset
  from deepchecks.tabular.utils.feature_importance import _calculate_feature_importance, calculate_feature_importance_or_none, column_importance_sorter_df, column_importance_sorter_dict, validate_feature_importance
  from deepchecks.tabular.utils.task_inference import get_all_labels, infer_classes_from_model, infer_task_type_by_class_number, infer_task_type_by_labels
  from deepchecks.tabular.utils.task_type import TaskType
label_desc: Use image node_id 9 for calling a global function with example usage: test_calculate_importance_when_model_is_pipeline(iris_labeled_dataset, caplog) without return types