code: def _safe_str(obj):
      """Helper for assert_* ports"""
      try:
          return str(obj)
      except Exception:
          return object.__str__(obj)
  
imports: from __future__ import print_function
  import numpy
  import sys
  import os
  import inspect
  import gc
  import pytest
  import functools
  from packaging.version import Version
  from ..util.check_environment import has_backend
label_desc: Use image node_id 3 for calling a global function with example usage: _safe_str(obj) and returns: str, object