code: def test__check_result_summarisation(
      caplog, mock_tree_shap_explainer, cat_vars_start_enc_dim
  ):
      """
      Test results summarisation checking function behaves correctly.
      """
  
      caplog.set_level(logging.WARNING)
  
      explainer = mock_tree_shap_explainer
  
      cat_vars_start_idx, cat_vars_enc_dim = cat_vars_start_enc_dim
  
      explainer._check_result_summarisation(
          True,
          cat_vars_start_idx=cat_vars_start_idx,
          cat_vars_enc_dim=cat_vars_enc_dim,
      )
      records = caplog.records
  
      if (
          cat_vars_enc_dim is not None
          and cat_vars_start_idx is not None
      ):
          assert explainer.summarise_result
          assert not records
      else:
          assert not explainer.summarise_result
          assert records
  
imports: import itertools
  import logging
  import unittest
  from copy import copy
  from itertools import chain
  from unittest.mock import MagicMock
  from typing import Any, List
  import catboost
  import pandas
  import pytest
  import scipy.sparse
  import sklearn
  import shap
  import numpy
  import pandas
  import shap.utils._legacy
  from numpy.testing import assert_allclose, assert_almost_equal
  from scipy.special import expit
  from alibi.api.defaults import DEFAULT_META_KERNEL_SHAP, DEFAULT_DATA_KERNEL_SHAP, DEFAULT_META_TREE_SHAP, DEFAULT_DATA_TREE_SHAP, KERNEL_SHAP_PARAMS, TREE_SHAP_PARAMS
  from alibi.explainers.shap_wrappers import sum_categories, rank_by_importance, KernelExplainerWrapper
  from alibi.explainers.shap_wrappers import KERNEL_SHAP_BACKGROUND_THRESHOLD, TREE_SHAP_BACKGROUND_WARNING_THRESHOLD
  from alibi.explainers.tests.utils import get_random_matrix
  from alibi.tests.utils import assert_message_in_logs, not_raises
  from alibi.utils import DistributedExplainer
label_desc: Use image node_id 31 for calling a global function with example usage: test__check_result_summarisation(caplog, mock_tree_shap_explainer, cat_vars_start_enc_dim) without return types