code: def _repeat_trials(num_samples: int, repeat: int):
      class TestSuggestion(Searcher):
          index = 0
  
          def suggest(self, trial_id):
              self.index += 1
              return {"test_variable": 5 + self.index}
  
          def on_trial_complete(self, *args, **kwargs):
              return
  
      searcher = TestSuggestion(metric="episode_reward_mean")
      repeat_searcher = Repeater(
          searcher, repeat=repeat, set_index=False
      )
      alg = SearchGenerator(repeat_searcher)
  
      alg.add_configurations(
          {
              "test": {
                  "run": "__fake",
                  "num_samples": num_samples,
                  "stop": {"training_iteration": 1},
              }
          }
      )
  
      trials = []
      while not alg.is_finished():
          trials.append(alg.next_trial())
  
      return trials
  
file_path: ray/python/ray/tune/tests/test_searcher_utils.py
imports: import pytest
  from ray.tune.search import BasicVariantGenerator
  from ray.tune.search.repeater import Repeater
  from ray.tune.search import Searcher, ConcurrencyLimiter
  from ray.tune.search.search_generator import SearchGenerator
label_desc: Use image node_id 2 for calling a global function with example usage: _repeat_trials(num_samples, repeat) and returns: trials, dict