code: def safeformat(obj):
      """return a pretty printed string for the given object.
      Failing __repr__ functions of user instances will be represented
      with a short exception info.
      """
      return _call_and_format_exception(pprint.pformat, obj)
  
file_path: catboost/contrib/python/pytest/py2/_pytest/_io/saferepr.py
imports: import pprint
  from six.moves import reprlib
label_desc: Use image node_id 2 for calling a global function with example usage: safeformat(obj) and returns: _call_and_format_exception