code: def assert_raises(exp, func, *args, **kwargs):
      """Backport"""
      try:
          func(*args, **kwargs)
      except exp:
          return
      std_msg = "%s not raised" % (_safe_rep(exp))
      raise AssertionError(_format_msg(None, std_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 6 for calling a global function with example usage: assert_raises(exp, func) without return types