code: def test_compute_class_weight_not_present(
      y_type, class_weight, classes, err_msg
  ):
      # Raise error when y does not contain all class labels
      y = (
          np.asarray([0, 0, 0, 1, 1, 2])
          if y_type == "numeric"
          else np.asarray(["dog", "cat", "dog"])
      )
  
      print(y)
      with pytest.raises(ValueError, match=err_msg):
          compute_class_weight(class_weight, classes=classes, y=y)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from sklearn.datasets import make_blobs
  from sklearn.linear_model import LogisticRegression
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal
  from sklearn.utils.class_weight import compute_class_weight, compute_sample_weight
  from sklearn.utils.fixes import CSC_CONTAINERS
label_desc: Use image node_id 2 for calling a global function with example usage: test_compute_class_weight_not_present(y_type, class_weight, classes, err_msg) without return types