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