code: def _score(
      df,
      x,
      y,
      task,
      sample,
      cross_validation,
      random_seed,
      invalid_score,
      catch_errors,
  ):
      df, case_type = _determine_case_and_prepare_df(
          df, x, y, sample=sample, random_seed=random_seed
      )
      task = _get_task(case_type, invalid_score)
  
      if case_type in ["classification", "regression"]:
          model_score = _calculate_model_cv_score_(
              df,
              target=y,
              feature=x,
              task=task,
              cross_validation=cross_validation,
              random_seed=random_seed,
          )
          # IDEA: the baseline_scores do sometimes change significantly, e.g. for F1 and thus change the PPS
          # we might want to calculate the baseline_score 10 times and use the mean in order to have less variance
          ppscore, baseline_score = task["score_normalizer"](
              df, y, model_score, random_seed=random_seed
          )
      else:
          model_score = task["model_score"]
          baseline_score = task["baseline_score"]
          ppscore = task["ppscore"]
  
      return {
          "x": x,
          "y": y,
          "ppscore": ppscore,
          "case": case_type,
          "is_valid_score": task["is_valid_score"],
          "metric": task["metric_name"],
          "baseline_score": baseline_score,
          "model_score": abs(
              model_score
          ),  # sklearn returns negative mae
          "model": task["model"],
      }
  
imports: import warnings
  import numpy
  import pandas
  from pandas.api.types import is_bool_dtype, is_categorical_dtype, is_datetime64_any_dtype, is_numeric_dtype, is_object_dtype, is_string_dtype, is_timedelta64_dtype
  from sklearn import preprocessing, tree
  from sklearn.metrics import f1_score, mean_absolute_error
  from sklearn.model_selection import cross_val_score
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 11 for calling a global function with example usage: _score(df, x, y, task, sample, cross_validation, random_seed, invalid_score, catch_errors) and returns: dict