code: def utf8_repr(func):
      """
      ``__repr__`` methods in Python 2 don't allow unicode objects to be
      returned. Therefore cast them to utf-8 bytes in this decorator.
      """
  
      def wrapper(self):
          result = func(self)
          if isinstance(result, unicode):
              return result.encode("utf-8")
          else:
              return result
  
      if sys.version_info.major >= 3:
          return func
      else:
          return wrapper
  
imports: import os
  import sys
  import platform
label_desc: Use image node_id 3 for calling a global function with example usage: utf8_repr(func) and returns: func, wrapper, result, result