code: def _normalize_value(
      value: Optional[float], direction: StudyDirection
  ) -> float:
      if value is None:
          value = float("inf")
  
      if direction is StudyDirection.MAXIMIZE:
          value = -value
  
      return value
  
imports: from datetime import datetime
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import overload
  from typing import Sequence
  from typing import Union
  from optuna import multi_objective
  from optuna._convert_positional_args import convert_positional_args
  from optuna._deprecated import deprecated_class
  from optuna.distributions import BaseDistribution
  from optuna.study._study_direction import StudyDirection
  from optuna.trial import FrozenTrial
  from optuna.trial import Trial
  from optuna.trial import TrialState
  from optuna.trial._base import _SUGGEST_INT_POSITIONAL_ARGS
label_desc: Use image node_id 1 for calling a global function with example usage: _normalize_value(value, direction) and returns: value