Return a string with a prettified version of this object’s contents.

        The format is a multiline string where each line is of the form ``key
        = value``. If the *format* argument is equal to ``"str"``, each
        ``value`` is the stringification of the value; if it is ``"repr"``, it
        is its :func:`repr`.

        Calling :func:`str` on a :class:`Holder` returns a slightly different
        pretty stringification that uses a textual representation similar to a
        Python :class:`dict` literal.

def to_pretty(self, format='str'):
        """Return a string with a prettified version of this object’s contents.

        The format is a multiline string where each line is of the form ``key
        = value``. If the *format* argument is equal to ``"str"``, each
        ``value`` is the stringification of the value; if it is ``"repr"``, it
        is its :func:`repr`.

        Calling :func:`str` on a :class:`Holder` returns a slightly different
        pretty stringification that uses a textual representation similar to a
        Python :class:`dict` literal.

        """
        if format == 'str':
            template = '%-*s = %s'
        elif format == 'repr':
            template = '%-*s = %r'
        else:
            raise ValueError('unrecognized value for "format": %r' % format)

        d = self.__dict__
        maxlen = 0

        for k in six.iterkeys(d):
            maxlen = max(maxlen, len(k))

        return '\n'.join(template % (maxlen, k, d[k])
                         for k in sorted(six.iterkeys(d)))