class_docstr: Class to interface with the Ax Platform
class_docstr_tok: ["Class","to","interface","with","the","Ax","Platform"]
code: def sweep_over_batches(
      self, ax_client: AxClient, list_of_trials: List[Trial]
  ) -> None:
      assert self.launcher is not None
      assert self.job_idx is not None
  
      chunked_batches = self.chunks(list_of_trials, self.max_batch_size)
      for batch in chunked_batches:
          overrides = [x.overrides for x in batch]
          self.validate_batch_is_legal(overrides)
          rets = self.launcher.launch(
              job_overrides=overrides, initial_job_idx=self.job_idx
          )
          self.job_idx += len(rets)
          for idx in range(len(batch)):
              val: Any = rets[idx].return_value
              # Ax expects a measured value (int or float), which can optionally
              # be given in a tuple along with the error of that measurement.
              # Alternatively, the task function can return a dict whose values
              # represent multiple metrics, where each key is the name of the metric
              # and the item can be an int, float or tuple.
              assert isinstance(val, (int, float, tuple, dict))
              # is_noisy specifies how Ax should behave when not given an error value.
              # if true (default), the error of each measurement is inferred by Ax.
              # if false, the error of each measurement is set to 0.
              if isinstance(val, (int, float)):
                  if self.is_noisy:
                      val = (val, None)  # specify unknown noise
                  else:
                      val = (val, 0)  # specify no noise
              ax_client.complete_trial(
                  trial_index=batch[idx].trial_index, raw_data=val
              )
  
imports: import logging
  from dataclasses import dataclass
  from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  from ax.core import types
  from ax.exceptions.core import SearchSpaceExhausted
  from ax.service.ax_client import AxClient
  from hydra.core.override_parser.overrides_parser import OverridesParser
  from hydra.core.override_parser.types import IntervalSweep, Override, Transformer
  from hydra.core.plugins import Plugins
  from hydra.plugins.launcher import Launcher
  from hydra.plugins.sweeper import Sweeper
  from hydra.types import HydraContext, TaskFunction
  from omegaconf import DictConfig, OmegaConf
  from ._earlystopper import EarlyStopper
  from .config import AxConfig, ClientConfig, ExperimentConfig
label_desc: Use image node_id 4 for calling the CoreAxSweeper obj's underlying member method code with example usage: obj.sweep_over_batches(ax_client, list_of_trials) without return types