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.
docstr: Generates Trial objects with the variant generation process.
  
  Uses a fixed point iteration to resolve variants. All trials
  should be able to be generated at once.
  
  See also: `ray.tune.search.variant_generator`.
  
  Returns:
      Trial object
code: def __next__(self):
      """Generates Trial objects with the variant generation process.
  
      Uses a fixed point iteration to resolve variants. All trials
      should be able to be generated at once.
  
      See also: `ray.tune.search.variant_generator`.
  
      Returns:
          Trial object
      """
  
      if "run" not in self.unresolved_spec:
          raise TuneError(
              "Must specify `run` in {}".format(self.unresolved_spec)
          )
  
      if self.variants and self.variants.has_next():
          # This block will be skipped upon instantiation.
          # `variants` will be set later after the first loop.
          resolved_vars, spec = next(self.variants)
          return self.create_trial(resolved_vars, spec)
  
      if self.points_to_evaluate:
          config = self.points_to_evaluate.pop(0)
          self.num_samples_left -= 1
          self.variants = _VariantIterator(
              _get_preset_variants(
                  self.unresolved_spec,
                  config,
                  constant_grid_search=self.constant_grid_search,
                  random_state=self.random_state,
              ),
              lazy_eval=self.lazy_eval,
          )
          resolved_vars, spec = next(self.variants)
          return self.create_trial(resolved_vars, spec)
      elif self.num_samples_left > 0:
          self.variants = _VariantIterator(
              generate_variants(
                  self.unresolved_spec,
                  constant_grid_search=self.constant_grid_search,
                  random_state=self.random_state,
              ),
              lazy_eval=self.lazy_eval,
          )
          self.num_samples_left -= 1
          resolved_vars, spec = next(self.variants)
          return self.create_trial(resolved_vars, spec)
      else:
          raise StopIteration
  
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 3 for calling the _TrialIterator obj's underlying member method code with example usage: obj.__next__() and returns: self, self, self