<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def next_trials(self):
 """Provides Trial objects to be queued into the TrialRunner. Returns: trials (list):
 Returns a list of trials. """

        trials = list(self._trial_generator)
        if self._shuffle:
            random.shuffle(trials)
        self._finished = True
        return trials