code: def _log_failed_trial(
      trial: FrozenTrial,
      message: Union[str, Warning],
      exc_info: Any = None,
      value_or_values: Any = None,
  ) -> None:
      _logger.warning(
          "Trial {} failed with parameters: {} because of the following error: {}.".format(
              trial.number, trial.params, message
          ),
          exc_info=exc_info,
      )
  
      _logger.warning(
          "Trial {} failed with value {}.".format(
              trial.number, repr(value_or_values)
          )
      )
  
imports: from concurrent.futures import FIRST_COMPLETED
  from concurrent.futures import Future
  from concurrent.futures import ThreadPoolExecutor
  from concurrent.futures import wait
  import datetime
  import gc
  import itertools
  import os
  import sys
  from typing import Any
  from typing import Callable
  from typing import List
  from typing import Optional
  from typing import Sequence
  from typing import Set
  from typing import Tuple
  from typing import Type
  from typing import Union
  import warnings
  import optuna
  from optuna import exceptions
  from optuna import logging
  from optuna import progress_bar
  from optuna import trial
  from optuna.storages._heartbeat import get_heartbeat_thread
  from optuna.storages._heartbeat import is_heartbeat_enabled
  from optuna.study._tell import _tell_with_warning
  from optuna.study._tell import STUDY_TELL_WARNING_KEY
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 4 for calling a global function with example usage: _log_failed_trial(trial, message, exc_info, value_or_values) without return types