code: def test_random_starts():
      # Test that an increasing number of random-starts of GP fitting only
      # increases the log marginal likelihood of the chosen theta.
      n_samples, n_features = 25, 2
      rng = np.random.RandomState(0)
      X = rng.randn(n_samples, n_features) * 2 - 1
      y = (
          np.sin(X).sum(axis=1)
          + np.sin(3 * X).sum(axis=1)
          + rng.normal(scale=0.1, size=n_samples)
      )
  
      kernel = C(1.0, (1e-2, 1e2)) * RBF(
          length_scale=[1.0] * n_features,
          length_scale_bounds=[(1e-4, 1e2)] * n_features,
      ) + WhiteKernel(noise_level=1e-5, noise_level_bounds=(1e-5, 1e1))
      last_lml = -np.inf
      for n_restarts_optimizer in range(5):
          gp = GaussianProcessRegressor(
              kernel=kernel,
              n_restarts_optimizer=n_restarts_optimizer,
              random_state=0,
          ).fit(X, y)
          lml = gp.log_marginal_likelihood(gp.kernel_.theta)
          assert lml > last_lml - np.finfo(np.float32).eps
          last_lml = lml
  
imports: import re
  import sys
  import warnings
  import numpy
  import pytest
  from scipy.optimize import approx_fprime
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.gaussian_process import GaussianProcessRegressor
  from sklearn.gaussian_process.kernels import RBF, DotProduct, ExpSineSquared, WhiteKernel
  from sklearn.gaussian_process.kernels import ConstantKernel
  from sklearn.gaussian_process.tests._mini_sequence_kernel import MiniSeqKernel
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_less
label_desc: Use image node_id 15 for calling a global function with example usage: test_random_starts() without return types