class_docstr: Generates trials from the spec.
  
  Args:
      uuid_prefix: Used in creating the trial name.
      num_samples: Number of samples from distribution
           (same as tune.TuneConfig).
      unresolved_spec: Experiment specification
          that might have unresolved distributions.
      constant_grid_search: Should random variables be sampled
          first before iterating over grid variants (True) or not (False).
      points_to_evaluate: Configurations that will be tried out without sampling.
      lazy_eval: Whether variants should be generated
          lazily or eagerly. This is toggled depending
          on the size of the grid search.
      start: index at which to start counting trials.
      random_state (int | np.random.Generator | np.random.RandomState):
          Seed or numpy random generator to use for reproducible results.
          If None (default), will use the global numpy random generator
          (``np.random``). Please note that full reproducibility cannot
          be guaranteed in a distributed enviroment.
code: def __init__(
      self,
      uuid_prefix: str,
      num_samples: int,
      unresolved_spec: dict,
      constant_grid_search: bool = False,
      points_to_evaluate: Optional[List] = None,
      lazy_eval: bool = False,
      start: int = 0,
      random_state: Optional[
          Union[int, "np_random_generator", np.random.RandomState]
      ] = None,
  ):
      self.parser = _make_parser()
      self.num_samples = num_samples
      self.uuid_prefix = uuid_prefix
      self.num_samples_left = num_samples
      self.unresolved_spec = unresolved_spec
      self.constant_grid_search = constant_grid_search
      self.points_to_evaluate = points_to_evaluate or []
      self.num_points_to_evaluate = len(self.points_to_evaluate)
      self.counter = start
      self.lazy_eval = lazy_eval
      self.variants = None
      self.random_state = random_state
  
imports: import copy
  import glob
  import itertools
  import os
  import uuid
  from typing import Dict, List, Optional, Union, TYPE_CHECKING
  import warnings
  import numpy
  from ray.air._internal.usage import tag_searcher
  from ray.tune.error import TuneError
  from ray.tune.experiment.config_parser import _make_parser, _create_trial_from_spec
  from ray.tune.search.sample import np_random_generator, _BackwardsCompatibleNumpyRng
  from ray.tune.search.variant_generator import _count_variants, _count_spec_samples, generate_variants, format_vars, _flatten_resolved_vars, _get_preset_variants
  from ray.tune.search.search_algorithm import SearchAlgorithm
  from ray.tune.utils.util import _atomic_save, _load_newest_checkpoint
  from ray.util import PublicAPI
label_desc: Use image node_id 1 to create a new _TrialIterator object  with example: obj = _TrialIterator(uuid_prefix, num_samples, unresolved_spec, constant_grid_search, points_to_evaluate, lazy_eval, start, random_state)