code: def _check_values_are_feasible(
      study: "optuna.Study", values: Sequence[float]
  ) -> Optional[str]:
      for v in values:
          # TODO(Imamura): Construct error message taking into account all values and do not early
          # return `value` is assumed to be ignored on failure so we can set it to any value.
          try:
              float(v)
          except (ValueError, TypeError):
              return f"The value {repr(v)} could not be cast to float"
  
          if math.isnan(v):
              return f"The value {v} is not acceptable"
  
      if len(study.directions) != len(values):
          return (
              f"The number of the values {len(values)} did not match the number of the objectives "
              f"{len(study.directions)}"
          )
  
      return None
  
file_path: optuna/optuna/study/_tell.py
imports: import copy
  import math
  from typing import Optional
  from typing import Sequence
  from typing import Union
  import warnings
  import optuna
  from optuna import logging
  from optuna import pruners
  from optuna import trial
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 3 for calling a global function with example usage: _check_values_are_feasible(study, values) and returns: None, str, len, str, len, str, v, str, str, repr, str