code: def _format_leaf_value(tree_obj, node):
      # type: (...) -> str
      if tree_obj.is_classification:
          if len(node.value_ratio) == 2:
              return "{:0.3f}".format(node.value_ratio[1])
          else:
              return _format_array(node.value_ratio, "{:0.3f}")
      else:
          value = node.value
          if len(value) == 1:
              return "{}".format(value[0])
          else:
              assert all(len(v) == 1 for v in value)
              return _format_array([v[0] for v in value], "{}")
  
imports: from typing import Any
  from eli5.base import TreeInfo, NodeInfo
label_desc: Use image node_id 2 for calling a global function with example usage: _format_leaf_value(tree_obj, node) and returns: str, _format_array, str, _format_array