def format_value(value):
        """Pretty-print an arbitrary 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)