def as_unicode(obj, encoding=convert.LOCALE, pretty=False):
    """
    Representing any object to <unicode> string (python2.7) or <str> string (python3.0).

    :param obj: any object
    :type encoding: str
    :param encoding: codec for encoding unicode strings
                     (locale.getpreferredencoding() by default)
    :type pretty: bool
    :param pretty: pretty print

    :rtype: unicode
    :return: any object as unicode string
    """

    return convert.convert(obj, encoding, 0 if pretty else None)
def as_unicode ( obj , encoding = convert . LOCALE , pretty = False ) : return convert . convert ( obj , encoding , 0 if pretty else None )
Representing any object to <unicode> string (python2.7) or <str> string (python3.0).

    :param obj: any object
    :type encoding: str
    :param encoding: codec for encoding unicode strings
                     (locale.getpreferredencoding() by default)
    :type pretty: bool
    :param pretty: pretty print

    :rtype: unicode
    :return: any object as unicode string