class_docstr: Traverse the search space and try all the possible combinations one by one.
  
  Parameters
  ----------
  shuffle
      Shuffle the order in a candidate list, so that they are tried in a random order.
      Currently, the implementation is a pseudo-random shuffle, which only shuffles the order of every 100 candidates.
  seed
      Random seed.
class_docstr_tok: ["Traverse","the","search","space","and","try","all","the","possible","combinations","one","by","one",".","Parameters","--","--","--","--","--","shuffle","Shuffle","the","order","in","a","candidate","list",",","so","that","they","are","tried","in","a","random","order",".","Currently",",","the","implementation","is","a","pseudo-random","shuffle",",","which","only","shuffles","the","order","of","every","100","candidates",".","seed","Random","seed","."]
code: def _run(self) -> None:
      generator = self._grid_generator(self.model_space)
  
      if self.shuffle:
          # Shuffle the order of every `_shuffle_buffer_size` candidates.
          shuffle_buffer = []
          generator_running = True
  
          # Already generated does not mean already submitted.
          # We need to keep track of the granularity actually processed,
          # to avoid skipping granularities when resuming.
          self._granularity_processed = self._granularity
  
          while generator_running:
              should_submit = False
              try:
                  next_model = next(generator)
                  shuffle_buffer.append(next_model)
                  if len(shuffle_buffer) == self._shuffle_buffer_size:
                      should_submit = True
              except StopIteration:
                  # Submit the final models.
                  should_submit = True
                  generator_running = False
  
              if should_submit:
                  # Submit models and clear the shuffle buffer.
                  self._random_state.shuffle(shuffle_buffer)
                  for model in shuffle_buffer:
                      if not self.wait_for_resource():
                          _logger.info(
                              "Budget exhausted, but search space is not exhausted."
                          )
                          return
                      self.engine.submit_models(model)
                  shuffle_buffer = []
  
                  # Update granularity processed.
                  self._granularity_processed = self._granularity
  
      else:
          # Keep this in a separate branch because it's very simple.
          for model in generator:
              if not self.wait_for_resource():
                  _logger.info(
                      "Budget exhausted, but search space is not exhausted."
                  )
                  return
              self.engine.submit_models(model)
  
imports: from __future__ import annotations
  import logging
  import warnings
  from typing import Iterator, Any
  from numpy.random import RandomState
  from nni.mutable import Sample
  from nni.nas.space import ExecutableModelSpace
  from .base import Strategy
  from .utils import DeduplicationHelper, RetrySamplingHelper
label_desc: Use image node_id 4 for calling the GridSearch obj's underlying member method code with example usage: obj._run() without return types