code: def next_trials(self):
          
          trials = []
  
          for trial in self._trial_generator:
              if trial is None:
                  return trials
              trials += [trial]
  
          self._finished = True
          return trials
docs: Provides a batch of Trial objects to be queued into the TrialRunner.
  
          A batch ends when self._trial_generator returns None.
  
          Returns:
              trials (list): Returns a list of trials.