code: def test_class_weights():
      # Test class weights.
      X2 = np.array(
          [
              [-1.0, -1.0],
              [-1.0, 0],
              [-0.8, -1.0],
              [1.0, 1.0],
              [1.0, 0.0],
          ]
      )
      y2 = [1, 1, 1, -1, -1]
  
      clf = PassiveAggressiveClassifier(
          C=0.1, max_iter=100, class_weight=None, random_state=100
      )
      clf.fit(X2, y2)
      assert_array_equal(clf.predict([[0.2, -1.0]]), np.array([1]))
  
      # we give a small weights to class 1
      clf = PassiveAggressiveClassifier(
          C=0.1, max_iter=100, class_weight={1: 0.001}, random_state=100
      )
      clf.fit(X2, y2)
  
      # now the hyperplane should rotate clock-wise and
      # the prediction on this point should shift
      assert_array_equal(clf.predict([[0.2, -1.0]]), np.array([-1]))
  
imports: import numpy
  import pytest
  from sklearn.base import ClassifierMixin
  from sklearn.datasets import load_iris
  from sklearn.linear_model import PassiveAggressiveClassifier, PassiveAggressiveRegressor
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 6 for calling a global function with example usage: test_class_weights() without return types