code: def _format_value(value: any):
      if isinstance(value, bool):
          return _format_bool(value)
      elif isinstance(value, int):
          return _format_int(value)
      elif isinstance(value, float):
          return _format_float(value)
  
      try:
          import numpy
      except ImportError:
          numpy = None
  
      if numpy is None:
          return None
  
      if isinstance(value, numpy.number) and numpy.issubdtype(
          value, numpy.integer
      ):
          return _format_int(int(value))
      elif isinstance(value, numpy.number) and numpy.issubdtype(
          value, numpy.floating
      ):
          if numpy.isnan(value):
              return "NaN"
          return _format_float(float(value))
  
      try:
          import torch
      except ImportError:
          torch = None
  
      if torch is not None:
          if isinstance(value, torch.Tensor):
              if not value.shape:
                  return _format_value(value.item())
              else:
                  return None
  
      return None
  
imports: import collections
  import math
  from typing import TYPE_CHECKING, List, Tuple
  from labml.internal.util.colors import StyleCode
  from ....logger import Text
label_desc: Use image node_id 4 for calling a global function with example usage: _format_value(value) and returns: None, _format_bool, None, _format_int, _format_int, _format_float, _format_float, str, _format_value, None