docstr: This method isn't supposed to raise anything.
docstr_tok: ["This","method","is","n't","supposed","to","raise","anything","."]
code: def _given_failed_trial_split_that_continues_on_error(
      self, trial: Trial
  ):
      """
      This method isn't supposed to raise anything.
      """
      try:
          with trial.new_validation_split(
              continue_loop_on_error=True
          ) as trial_split:
              trial_split: TrialSplit = trial_split.with_n_epochs(3)
  
              trial_split.next_epoch()
              with trial_split.managed_metric(
                  SOME_OTHER_METRIC_NAME_MSE,
                  higher_score_is_better=False,
              ) as metric:
                  metric: MetricResults = metric
  
                  metric.add_train_result(0.45)
                  metric.add_valid_result(0.5)
  
              trial_split.next_epoch()
              with trial_split.managed_metric(
                  SOME_OTHER_METRIC_NAME_MSE,
                  higher_score_is_better=False,
              ) as metric:
                  metric: MetricResults = metric
  
                  metric.add_train_result(0.6)
                  metric.add_valid_result(0.7)
  
              trial_split.next_epoch()
              with trial_split.managed_metric(
                  SOME_OTHER_METRIC_NAME_MSE,
                  higher_score_is_better=False,
              ) as metric:
                  metric: MetricResults = metric
  
                  metric.add_train_result(0.4)
                  metric.add_valid_result(0.4)
  
                  raise IndexError("index error")
          return trial._validation_splits[-1]
      except IndexError as e:
          assert False, (
              f"This should not happen: IndexError should be handled by the "
              f"`trial.new_validation_split(continue_loop_on_error=True)` "
              f"context manager... Here is the error: `{e}`."
          )
  
imports: import copy
  import datetime
  import json
  from neuraxle.base import TrialStatus
  from neuraxle.hyperparams.space import HyperparameterSamples
  from neuraxle.logging.logging import LOGGING_DATETIME_STR_FORMAT
  from neuraxle.metaopt.context import AutoMLContext
  from neuraxle.metaopt.data.aggregates import MetricResults, Round, Trial, TrialSplit
  from neuraxle.metaopt.data.vanilla import ClientDataclass, MetricResultsDataclass, RoundDataclass, ScopedLocation, TrialDataclass, to_json
  from testing_neuraxle.metaopt.test_automl_dataclasses import SOME_FULL_SCOPED_LOCATION, SOME_ROOT_DATACLASS, SOME_TRIAL_DATACLASS
label_desc: Use image node_id 16 for calling the TestTrials obj's underlying member method code with example usage: obj._given_failed_trial_split_that_continues_on_error(trial) and returns: trial