code: def test_is_done_max_trials(self, num: int):
      space = self.create_space()
  
      MAX_TRIALS = 10
      algo = self.create_algo(space=space)
      algo.algorithm.max_trials = MAX_TRIALS
  
      rng = np.random.RandomState(123456)
  
      objective = 0
      while not algo.is_done:
          trials = algo.suggest(num)
          assert trials is not None
          if trials:
              self.observe_trials(trials, algo, rng)
  
      # BPT should ignore max trials.
      assert algo.n_observed > MAX_TRIALS
      # BPT should stop when all trials of last generation are completed.
      assert algo.n_observed == population_size * (generations + 1)
      assert algo.is_done
  
imports: from __future__ import annotations
  import functools
  import logging
  from typing import ClassVar
  import numpy
  import pytest
  from base import ExploitStub, ExploreStub, sample_trials
  from pytest_mock import MockerFixture
  from orion.algo.pbt.pbt import PBT, compute_fidelities
  from orion.algo.space import Space
  from orion.core.worker.primary_algo import SpaceTransform, create_algo
  from orion.core.worker.transformer import ReshapedSpace, TransformedSpace
  from orion.core.worker.trial import Trial
  from orion.testing.algo import BaseAlgoTests, TestPhase
label_desc: Use image node_id 3 for calling the TestGenericPBT obj's underlying member method code with example usage: obj.test_is_done_max_trials(num) without return types