code: def run_fi_calculation(
      model, dataset, permutation_kwargs=None, force_permutation=False
  ):
      labels = get_all_labels(model, dataset)
      observed_classes = sorted(labels.dropna().unique().tolist())
      model_classes = infer_classes_from_model(model)
      if dataset and dataset.label_type:
          task_type = dataset.label_type
      elif model_classes:
          task_type = infer_task_type_by_class_number(
              len(model_classes)
          )
      else:
          task_type = infer_task_type_by_labels(labels)
      return _calculate_feature_importance(
          model=model,
          dataset=dataset,
          model_classes=model_classes,
          observed_classes=observed_classes,
          task_type=task_type,
          permutation_kwargs=permutation_kwargs,
          force_permutation=force_permutation,
      )
  
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 1 for calling a global function with example usage: run_fi_calculation(model, dataset, permutation_kwargs, force_permutation) and returns: _calculate_feature_importance