code: def format_value(value):
          
          if isinstance(value, (bool, np.bool_)):
              return str(value)
          elif isinstance(value, (int, np.integer)):
              return '{:n}'.format(value)
          elif isinstance(value, (float, np.floating)):
              return '{:g}'.format(value)
          else:
              return str(value)
docs: Pretty-print an arbitrary value.