code: def test_sum_equals_one():
      np.random.seed(42)
      n1, n2 = 100, 500
      X = np.concatenate(
          [
              np.random.normal(0, 1, (n1, 2)),
              np.random.normal(2, 1, (n2, 2)),
          ],
          axis=0,
      )
      y = np.concatenate(
          [np.zeros((n1, 1)), np.ones((n2, 1))], axis=0
      ).reshape(-1)
      mod = ConfusionBalancer(
          LogisticRegression(
              solver="lbfgs", multi_class="multinomial", max_iter=1000
          ),
          alpha=0.1,
      )
      mod.fit(X, y)
      assert np.all(
          np.isclose(mod.predict_proba(X).sum(axis=1), 1, atol=0.001)
      )
  
file_path: scikit-lego/tests/test_meta/test_confusion_balancer.py
imports: import numpy
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklego.common import flatten
  from sklego.meta import ConfusionBalancer
  from tests.conftest import classifier_checks, general_checks
label_desc: Use image node_id 2 for calling a global function with example usage: test_sum_equals_one() without return types