code: def test_warm_start(solver, fit_intercept, global_random_seed):
      n_samples, n_features = 100, 10
      X, y = make_regression(
          n_samples=n_samples,
          n_features=n_features,
          n_informative=n_features - 2,
          bias=fit_intercept * 1.0,
          noise=1.0,
          random_state=global_random_seed,
      )
      y = np.abs(y)  # Poisson requires non-negative targets.
      alpha = 1
      params = {
          "solver": solver,
          "fit_intercept": fit_intercept,
          "tol": 1e-10,
      }
  
      glm1 = PoissonRegressor(
          warm_start=False, max_iter=1000, alpha=alpha, **params
      )
      glm1.fit(X, y)
  
      glm2 = PoissonRegressor(
          warm_start=True, max_iter=1, alpha=alpha, **params
      )
      # As we intentionally set max_iter=1 such that the solver should raise a
      # ConvergenceWarning.
      with pytest.warns(ConvergenceWarning):
          glm2.fit(X, y)
  
      linear_loss = LinearModelLoss(
          base_loss=glm1._get_loss(),
          fit_intercept=fit_intercept,
      )
      sw = np.full_like(y, fill_value=1 / n_samples)
  
      objective_glm1 = linear_loss.loss(
          coef=np.r_[glm1.coef_, glm1.intercept_]
          if fit_intercept
          else glm1.coef_,
          X=X,
          y=y,
          sample_weight=sw,
          l2_reg_strength=alpha,
      )
      objective_glm2 = linear_loss.loss(
          coef=np.r_[glm2.coef_, glm2.intercept_]
          if fit_intercept
          else glm2.coef_,
          X=X,
          y=y,
          sample_weight=sw,
          l2_reg_strength=alpha,
      )
      assert objective_glm1 < objective_glm2
  
      glm2.set_params(max_iter=1000)
      glm2.fit(X, y)
      # The two models are not exactly identical since the lbfgs solver
      # computes the approximate hessian from previous iterations, which
      # will not be strictly identical in the case of a warm start.
      rtol = 2e-4 if solver == "lbfgs" else 1e-9
      assert_allclose(glm1.coef_, glm2.coef_, rtol=rtol)
      assert_allclose(glm1.score(X, y), glm2.score(X, y), rtol=1e-5)
  
imports: import itertools
  import warnings
  from functools import partial
  import numpy
  import pytest
  import scipy
  from numpy.testing import assert_allclose
  from scipy import linalg
  from scipy.optimize import minimize, root
  from sklearn._loss import HalfBinomialLoss, HalfPoissonLoss, HalfTweedieLoss
  from sklearn._loss.link import IdentityLink, LogLink
  from sklearn.base import clone
  from sklearn.datasets import make_low_rank_matrix, make_regression
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.linear_model import GammaRegressor, PoissonRegressor, Ridge, TweedieRegressor
  from sklearn.linear_model._glm import _GeneralizedLinearRegressor
  from sklearn.linear_model._glm._newton_solver import NewtonCholeskySolver
  from sklearn.linear_model._linear_loss import LinearModelLoss
  from sklearn.metrics import d2_tweedie_score, mean_poisson_deviance
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 15 for calling a global function with example usage: test_warm_start(solver, fit_intercept, global_random_seed) without return types