code: def average_scores(scores, include_classes):
      result = {}
      for metric, classes_scores in scores.items():
          origin_score = 0
          simple_score = 0
          total = 0
          for clas, models_scores in classes_scores.items():
              # Skip if class is not in class list
              if (
                  include_classes is not None
                  and clas not in include_classes
              ):
                  continue
              origin_score += models_scores["Origin"]
              simple_score += models_scores["Simple"]
              total += 1
  
          result[metric] = {
              "Origin": origin_score / total,
              "Simple": simple_score / total,
          }
      return result
  
imports: import warnings
  from collections import defaultdict
  from numbers import Number
  from typing import TYPE_CHECKING, Callable, Dict, Hashable, List, Mapping, Union
  import numpy
  import pandas
  import plotly.express
  from sklearn.dummy import DummyClassifier, DummyRegressor
  from sklearn.pipeline import Pipeline
  from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
  from deepchecks.core import CheckResult, ConditionResult
  from deepchecks.core.condition import ConditionCategory
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.tabular import Context, Dataset, TrainTestCheck
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.utils.distribution.preprocessing import ScaledNumerics
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.metrics import get_gain
  from deepchecks.utils.simple_models import ClassificationUniformModel, RandomModel, RegressionUniformModel
  from deepchecks.utils.strings import format_percent
label_desc: Use image node_id 2 for calling a global function with example usage: average_scores(scores, include_classes) and returns: result