code: def _format_msg(msg, std_msg):
      """Helper for assert_* ports"""
      if msg is None:
          msg = std_msg
      else:
          try:
              msg = "%s : %s" % (std_msg, msg)
          except UnicodeDecodeError:
              msg = "%s : %s" % (_safe_str(std_msg), _safe_str(msg))
      return msg
  
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 4 for calling a global function with example usage: _format_msg(msg, std_msg) and returns: msg