code: def test__check_inputs_kernel(
      caplog,
      mock_kernel_shap_explainer,
      data_type,
      data_dimension,
      group_settings,
      input_settings,
      summarise_background,
  ):
      """
      Tests that the _check_inputs method logs the expected warnings and info messages.
      """
  
      caplog.set_level(logging.INFO)
  
      # generate grouping inputs for testing (b_ = bool var)
      b_group_names, b_groups, b_weights = group_settings
      use_groups = b_group_names or b_groups
      if len(data_dimension) == 1:
          data_dimension = (0, data_dimension[0])
      group_names, groups, weights, data = generate_test_data(
          data_dimension,
          *group_settings,
          **input_settings,
          data_type=data_type,
      )
  
      _, error_type = (
          input_settings["correct"],
          input_settings["error_type"],
      )
  
      # initialise a KernelShap with a mock predictor
      explainer = mock_kernel_shap_explainer
      explainer.use_groups = use_groups
      explainer.summarise_background = summarise_background
      explainer._check_inputs(data, group_names, groups, weights)
      records = caplog.records
  
      #
      grouping_errors = [
          "groups_dim_mismatch",
          "groups_type",
          "groups_group_names_mismatch",
          "name_dim_mismatch",
      ]
  
      # if shap_utils.Data is passed, expect no warnings
      if data_type == "data":
          if summarise_background:
              if data.data.shape[0] > KERNEL_SHAP_BACKGROUND_THRESHOLD:
                  msg_start = (
                      "Large datasets can cause slow runtimes for shap."
                  )
                  assert_message_in_logs(msg_start, records)
          else:
              assert not records
              assert not explainer.use_groups
      elif (
          data.ndim == 1 or data.shape[0] == 1
      ):  # pd.Series or single row
          if b_weights:
              assert explainer.ignore_weights
          if error_type in grouping_errors:
              assert not explainer.use_groups
          else:
              if error_type != "check_transpose":
                  if use_groups:
                      assert explainer.use_groups
              else:
                  assert not explainer.use_groups
              assert not explainer.transposed
      else:
          if data.shape[0] > KERNEL_SHAP_BACKGROUND_THRESHOLD:
              msg_start = (
                  "Large datasets can cause slow runtimes for shap."
              )
              assert_message_in_logs(msg_start, records)
  
          # if the group names are specified but no lists with indices for each
          # groups are passed, we inform the users that we assume len=1 groups.
          if b_group_names and not b_groups:
              msg_start = (
                  "Specified group_names but no corresponding sequence 'groups' "
                  "with indices for each group was specified."
              )
              assert_message_in_logs(msg_start, records)
              if error_type == "name_dim_mismatch":
                  assert not explainer.use_groups
              else:
                  assert explainer.use_groups
  
          # if group names are not specified but groups are, we warn the user
          # and automatically create group names.
          if b_groups and not b_group_names:
              assert explainer.create_group_names
  
          if b_groups:
              if error_type in grouping_errors:
                  assert not explainer.use_groups
              elif error_type == "check_transpose":
                  assert explainer.transposed
              else:
                  assert explainer.use_groups
                  assert not explainer.transposed
  
          if b_weights:
              if error_type == "weights_dim_mismatch":
                  assert explainer.ignore_weights
              elif error_type == "check_transposed":
                  assert not explainer.ignore_weights
              else:
                  assert not explainer.ignore_weights
  
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 15 for calling a global function with example usage: test__check_inputs_kernel(caplog, mock_kernel_shap_explainer, data_type, data_dimension, group_settings, input_settings, summarise_background) without return types