code: def fmt_item(x, l):
      if isinstance(x, np.ndarray):
          assert x.ndim == 0
          x = x.item()
      if isinstance(x, (float, np.float32, np.float64)):
          v = abs(x)
          if (v < 1e-4 or v > 1e4) and v > 0:
              rep = "%7.2e" % x
          else:
              rep = "%7.5f" % x
      else:
          rep = str(x)
      return " " * (l - len(rep)) + rep
  
file_path: baselines/baselines/common/console_util.py
imports: from __future__ import print_function
  from contextlib import contextmanager
  import numpy
  import time
  import shlex
  import subprocess
label_desc: Use image node_id 2 for calling a global function with example usage: fmt_item(x, l) and returns: unknown