code: def _sampling_strategy_dict(sampling_strategy, y, sampling_type):
      """Returns sampling target by converting the dictionary depending of the
      sampling."""
      target_stats = _count_class_sample(y)
      # check that all keys in sampling_strategy are also in y
      set_diff_sampling_strategy_target = set(
          sampling_strategy.keys()
      ) - set(target_stats.keys())
      if len(set_diff_sampling_strategy_target) > 0:
          raise ValueError(
              f"The {set_diff_sampling_strategy_target} target class is/are not "
              f"present in the data."
          )
      # check that there is no negative number
      if any(n_samples < 0 for n_samples in sampling_strategy.values()):
          raise ValueError(
              f"The number of samples in a class cannot be negative."
              f"'sampling_strategy' contains some negative value: {sampling_strategy}"
          )
      sampling_strategy_ = {}
      if sampling_type == "over-sampling":
          max(target_stats.values())
          max(target_stats, key=target_stats.get)
          for class_sample, n_samples in sampling_strategy.items():
              if n_samples < target_stats[class_sample]:
                  raise ValueError(
                      f"With over-sampling methods, the number"
                      f" of samples in a class should be greater"
                      f" or equal to the original number of samples."
                      f" Originally, there is {target_stats[class_sample]} "
                      f"samples and {n_samples} samples are asked."
                  )
              sampling_strategy_[class_sample] = (
                  n_samples - target_stats[class_sample]
              )
      elif sampling_type == "under-sampling":
          for class_sample, n_samples in sampling_strategy.items():
              if n_samples > target_stats[class_sample]:
                  raise ValueError(
                      f"With under-sampling methods, the number of"
                      f" samples in a class should be less or equal"
                      f" to the original number of samples."
                      f" Originally, there is {target_stats[class_sample]} "
                      f"samples and {n_samples} samples are asked."
                  )
              sampling_strategy_[class_sample] = n_samples
      elif sampling_type == "clean-sampling":
          raise ValueError(
              "'sampling_strategy' as a dict for cleaning methods is "
              "not supported. Please give a list of the classes to be "
              "targeted by the sampling."
          )
      else:
          raise NotImplementedError
  
      return sampling_strategy_
  
imports: import warnings
  from collections import OrderedDict
  from functools import wraps
  from inspect import Parameter, signature
  from numbers import Integral, Real
  import numpy
  from sklearn.base import clone
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_array, column_or_1d
  from sklearn.utils.multiclass import type_of_target
  from sklearn.utils.validation import _num_samples
  from .fixes import _is_pandas_df
label_desc: Use image node_id 11 for calling a global function with example usage: _sampling_strategy_dict(sampling_strategy, y, sampling_type) and returns: sampling_strategy_