code: def test_sampling_strategy_dict_error():
      y = np.array([1] * 50 + [2] * 100 + [3] * 25)
      sampling_strategy = {1: -100, 2: 50, 3: 25}
      with pytest.raises(
          ValueError, match="in a class cannot be negative."
      ):
          check_sampling_strategy(
              sampling_strategy, y, "under-sampling"
          )
      sampling_strategy = {1: 45, 2: 100, 3: 70}
      error_regex = (
          "With over-sampling methods, the number of samples in a"
          " class should be greater or equal to the original number"
          " of samples. Originally, there is 50 samples and 45"
          " samples are asked."
      )
      with pytest.raises(ValueError, match=error_regex):
          check_sampling_strategy(sampling_strategy, y, "over-sampling")
  
      error_regex = (
          "With under-sampling methods, the number of samples in a"
          " class should be less or equal to the original number of"
          " samples. Originally, there is 25 samples and 70 samples"
          " are asked."
      )
      with pytest.raises(ValueError, match=error_regex):
          check_sampling_strategy(
              sampling_strategy, y, "under-sampling"
          )
  
imports: from collections import Counter, OrderedDict
  import numpy
  import pytest
  from sklearn.cluster import KMeans
  from sklearn.neighbors import NearestNeighbors
  from sklearn.neighbors._base import KNeighborsMixin
  from sklearn.utils._testing import assert_array_equal
  from imblearn.utils import check_neighbors_object, check_sampling_strategy, check_target_type
  from imblearn.utils._validation import ArraysTransformer, _deprecate_positional_args, _is_neighbors_object
  from imblearn.utils.testing import _CustomNearestNeighbors
label_desc: Use image node_id 9 for calling a global function with example usage: test_sampling_strategy_dict_error() without return types