code: def unicode_compact(func):
      
  
      @wraps(func)
      def wrapped(self, text, *a, **kw):
          if not isinstance(text, six.text_type):
              text = text.decode('utf-8')
          return func(self, text, *a, **kw)
  
      return wrapped
docs: Make sure the first parameter of the decorated method to be a unicode
      object.