def python_2_unicode_compatible(klass):
        klass.__unicode__ = klass.__str__
        klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
        return klass
A decorator that defines __unicode__ and __str__ methods under Python 2.
dataset/ETHPy150Open divio/django-filer/filer/utils/compatibility.py/python_2_unicode_compatible