code: def _format_eval_result(
      value: _EvalResultTuple, show_stdv: bool
  ) -> str:
      """Format metric string."""
      if len(value) == 4:
          return f"{value[0]}'s {value[1]}: {value[2]:g}"
      elif len(value) == 5:
          if show_stdv:
              return f"{value[0]}'s {value[1]}: {value[2]:g} + {value[4]:g}"  # type: ignore[misc]
          else:
              return f"{value[0]}'s {value[1]}: {value[2]:g}"
      else:
          raise ValueError("Wrong metric value")
  
imports: from collections import OrderedDict
  from dataclasses import dataclass
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
  from .basic import Booster, _ConfigAliases, _LGBM_BoosterEvalMethodResultType, _LGBM_BoosterEvalMethodResultWithStandardDeviationType, _log_info, _log_warning
label_desc: Use image node_id 1 for calling a global function with example usage: _format_eval_result(value, show_stdv) and returns: value, str, value, str, value, value, str, value, str, value, str, value, value, str, value, str, value