code: def __init__(
      self,
      trainer: Trainer,
      n_trials: int,
      hp_optimizer: BaseHyperparameterOptimizer = None,
      continue_loop_on_error: bool = True,
  ):
      if hp_optimizer is None:
          hp_optimizer = RandomSearchSampler()
  
      TruncableService.__init__(
          self,
          {
              Trainer: trainer,
              BaseHyperparameterOptimizer: hp_optimizer,
          },
      )
      self.n_trials = n_trials
      self.continue_loop_on_error: bool = continue_loop_on_error
  
imports: import gc
  from copy import copy
  from typing import ContextManager, Iterator, List, Optional, Tuple
  from neuraxle.base import CX, BaseService, BaseStep, BaseStepT, ExecutionContext, ExecutionMode, ForceHandleMixin, TruncableService, _HasChildrenMixin
  from neuraxle.data_container import ARG_X_INPUTTED, IDT
  from neuraxle.data_container import DataContainer
  from neuraxle.data_container import TrainDACT
  from neuraxle.hyperparams.space import HyperparameterSpace
  from neuraxle.metaopt.callbacks import ARG_Y_EXPECTED, ARG_Y_PREDICTD, BaseCallback, CallbackList, MetricCallback, ScoringCallback
  from neuraxle.metaopt.context import AutoMLContext
  from neuraxle.metaopt.data.aggregates import Client, Project, Root, Round, Trial, TrialSplit
  from neuraxle.metaopt.data.reporting import RoundReport
  from neuraxle.metaopt.data.vanilla import DEFAULT_CLIENT, DEFAULT_PROJECT, RoundDataclass, ScopedLocation
  from neuraxle.metaopt.optimizer import BaseHyperparameterOptimizer, GridExplorationSampler, RandomSearchSampler
  from neuraxle.metaopt.repositories.repo import HyperparamsRepository
  from neuraxle.metaopt.validation import BaseValidationSplitter, ValidationSplitter
label_desc: Use image node_id 1 to create a new BaseControllerLoop object from inherited base classes: TruncableService with example: obj = BaseControllerLoop(trainer, n_trials, hp_optimizer, continue_loop_on_error)