code: def _check_value(value: Any) -> float:
      try:
          # For convenience, we allow users to report a value that can be cast to `float`.
          value = float(value)
      except (TypeError, ValueError):
          message = "The `value` argument is of type '{}' but supposed to be a float.".format(
              type(value).__name__
          )
          raise TypeError(message) from None
  
      return value
  
file_path: optuna/optuna/pruners/_threshold.py
imports: import math
  from typing import Any
  from typing import Optional
  import optuna
  from optuna.pruners import BasePruner
  from optuna.pruners._percentile import _is_first_in_interval_step
label_desc: Use image node_id 1 for calling a global function with example usage: _check_value(value) and returns: value