code: def _float2str(value: float, precision: Optional[int]) -> str:
      return (
          f"{value:.{precision}f}"
          if precision is not None and not isinstance(value, str)
          else str(value)
      )
  
file_path: LightGBM/python-package/lightgbm/plotting.py
imports: import math
  from copy import deepcopy
  from io import BytesIO
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from .basic import Booster, _data_from_pandas, _is_zero, _log_warning, _MissingType
  from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED, pd_DataFrame
  from .sklearn import LGBMModel
label_desc: Use image node_id 2 for calling a global function with example usage: _float2str(value, precision) and returns: unknown