code: def test_hyperband_mirrors_paper_and_metadata(
      max_iter, aggressiveness
  ):
      @gen_cluster(client=True)
      async def _test_mirrors_paper(c, s, a, b):
          X, y = make_classification(
              n_samples=10, n_features=4, chunks=10
          )
          model = ConstantFunction()
          params = {"value": np.random.rand(max_iter)}
          alg = HyperbandSearchCV(
              model,
              params,
              max_iter=max_iter,
              random_state=0,
              aggressiveness=aggressiveness,
          )
          await alg.fit(X, y)
  
          assert alg.metadata == alg.metadata_
  
          assert isinstance(alg.metadata["brackets"], list)
          assert set(alg.metadata.keys()) == {
              "n_models",
              "partial_fit_calls",
              "brackets",
          }
  
          # Looping over alg.metadata["bracketes"] is okay because alg.metadata
          # == alg.metadata_
          for bracket in alg.metadata["brackets"]:
              assert set(bracket.keys()) == {
                  "n_models",
                  "partial_fit_calls",
                  "bracket",
                  "SuccessiveHalvingSearchCV params",
                  "decisions",
              }
  
          if aggressiveness == 3:
              assert alg.best_score_ == params["value"].max()
  
      _test_mirrors_paper()
  
file_path: dask-ml/tests/model_selection/test_hyperband.py
imports: import logging
  import math
  import warnings
  import numpy
  import pandas
  import pytest
  import scipy.stats
  from dask import array, dataframe
  from distributed.utils_test import captured_logger, cluster, gen_cluster, loop
  from sklearn.linear_model import SGDClassifier
  from dask_ml._compat import DISTRIBUTED_2_5_0, SK_LOG_LOSS
  from dask_ml.datasets import make_classification
  from dask_ml.model_selection import HyperbandSearchCV, IncrementalSearchCV, SuccessiveHalvingSearchCV
  from dask_ml.model_selection._hyperband import _get_hyperband_params
  from dask_ml.utils import ConstantFunction
  from dask_ml.wrappers import Incremental
label_desc: Use image node_id 1 for calling a global function with example usage: test_hyperband_mirrors_paper_and_metadata(max_iter, aggressiveness) without return types