class_docstr: Report evaluation scores to Optuna and prune the trial if necessary.
  
  Optuna regards trials which raise `optuna.TrialPruned` as unpromissed and
  prune them at the early stages of the training.
  
  Note that this hook does not support
  pfrl.experiments.train_agent_async.train_agent_async.
  Optuna detects pruning signal by `optuna.TrialPruned` exception, but async training
  mode doesn't re-raise subprocess' exceptions. (See: pfrl.utils.async_.py)
  
  Args:
      trial (optuna.Trial): Current trial.
code: def __init__(self, trial):
      if not _optuna_available:
          raise RuntimeError(
              "OptunaPrunerHook requires optuna installed."
          )
      self.trial = trial
  
imports: from abc import ABCMeta, abstractmethod
label_desc: Use image node_id 1 to create a new OptunaPrunerHook object from inherited base classes: EvaluationHook with example: obj = OptunaPrunerHook(trial)