code: def safe_unicode(e):
      """unicode(e) with various fallbacks. Used for exceptions, which may not be
      safe to call unicode() on.
      """
      try:
          return str(e)
      except UnicodeError:
          pass
  
      try:
          return repr(e)
      except UnicodeError:
          pass
  
      return "Unrecoverably corrupt evalue"
  
file_path: catboost/contrib/python/ipython/py3/IPython/utils/py3compat.py
imports: import platform
  import builtins
  from .encoding import DEFAULT_ENCODING
label_desc: Use image node_id 4 for calling a global function with example usage: safe_unicode(e) and returns: str, str, repr