code: def is_classwise(scorer, model, dataset):
      """Check whether a given scorer provides an average score or a score for each class."""
      test_result = scorer(model, dataset.copy(dataset.data.head()))
      return isinstance(test_result, dict)
  
imports: import itertools
  from typing import Callable, Dict, Tuple, Union
  import numpy
  import pandas
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.checks import DatasetKind
  from deepchecks.core.errors import DeepchecksProcessError, DeepchecksValueError
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.utils.performance.partition import partition_column
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 3 for calling a global function with example usage: is_classwise(scorer, model, dataset) and returns: isinstance