code: def test_fi_n_top(diabetes_split_dataset_and_model):
      num_values = 5
      train, _, clf = diabetes_split_dataset_and_model
      columns_info = train.columns_info
      feature_importances, _ = run_fi_calculation(clf, train)
      assert_that(feature_importances, not_none())
  
      feature_importances_sorted = list(
          feature_importances.sort_values(ascending=False).keys()
      )
      feature_importances_sorted.insert(0, "target")
      feature_importances_sorted = feature_importances_sorted[
          :num_values
      ]
  
      sorted_dict = column_importance_sorter_dict(
          columns_info, train, feature_importances, num_values
      )
      assert_that(
          list(sorted_dict.keys()), equal_to(feature_importances_sorted)
      )
  
      columns_info_df = pd.DataFrame(
          [columns_info.keys(), columns_info.values()]
      ).T
      columns_info_df.columns = ["keys", "values"]
      sorted_df = column_importance_sorter_df(
          columns_info_df,
          train,
          feature_importances,
          num_values,
          col="keys",
      )
  
      assert_that(
          list(sorted_df["keys"]), equal_to(feature_importances_sorted)
      )
  
      columns_info_df = columns_info_df.set_index("keys")
      sorted_df = column_importance_sorter_df(
          columns_info_df, train, feature_importances, num_values
      )
  
      assert_that(
          list(sorted_df.index), equal_to(feature_importances_sorted)
      )
  
      columns_info_df = pd.DataFrame()
      sorted_df = column_importance_sorter_df(
          columns_info_df,
          train,
          feature_importances,
          num_values,
          col="keys",
      )
      assert_that(len(sorted_df), equal_to(0))
  
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 15 for calling a global function with example usage: test_fi_n_top(diabetes_split_dataset_and_model) without return types