code: def test_equal_class_weight():
      X2 = [[1, 0], [1, 0], [0, 1], [0, 1]]
      y2 = [0, 0, 1, 1]
      clf = PassiveAggressiveClassifier(
          C=0.1, tol=None, class_weight=None
      )
      clf.fit(X2, y2)
  
      # Already balanced, so "balanced" weights should have no effect
      clf_balanced = PassiveAggressiveClassifier(
          C=0.1, tol=None, class_weight="balanced"
      )
      clf_balanced.fit(X2, y2)
  
      clf_weighted = PassiveAggressiveClassifier(
          C=0.1, tol=None, class_weight={0: 0.5, 1: 0.5}
      )
      clf_weighted.fit(X2, y2)
  
      # should be similar up to some epsilon due to learning rate schedule
      assert_almost_equal(clf.coef_, clf_weighted.coef_, decimal=2)
      assert_almost_equal(clf.coef_, clf_balanced.coef_, decimal=2)
  
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 8 for calling a global function with example usage: test_equal_class_weight() without return types