code: def test_constrained_logistic_fit():
      X_raw, y = load_breast_cancer(return_X_y=True)
      mu, sig = X_raw.mean(axis=0), X_raw.std(axis=0)
      X = (X_raw - mu) / sig
      alphas = [10, 30, 100, 300, 1000, 3000]
  
      for a in alphas:
          model_skl = LogisticRegression(C=1 / a, fit_intercept=True)
          model_skl.fit(X, y)
          X_with_int = np.column_stack([np.ones(X.shape[0]), X])
          alpha_arr = np.zeros(X_with_int.shape[1])
          alpha_arr[1:] = a
          ridge_fit = constrained_logistic_fit(
              X_with_int, y, alpha_arr, guess=np.array([]), n_cov=0
          )
          beta_skl = np.concatenate(
              [model_skl.intercept_, model_skl.coef_.ravel()]
          )
          beta_glow = ridge_fit.x
          assert np.allclose(beta_skl, beta_glow, 0.01)
  
imports: from glow.wgr.model_functions import *
  from glow.wgr.model_functions import _prepare_covariates, _prepare_labels_and_warn
  import math
  import numpy
  import pandas
  from pyspark.sql import Row
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklearn.datasets import load_breast_cancer
label_desc: Use image node_id 14 for calling a global function with example usage: test_constrained_logistic_fit() without return types