code: def exception(expected_exception, callable_object, *args, **kwargs):
      try:
          callable_object(*args, **kwargs)
      except expected_exception:
          return
      except Exception as actual_exception:
          raise AssertionError(
              "Expected: '%s', Actual: '%s'"
              % (
                  expected_exception.__name__,
                  actual_exception.__class__.__name__,
              )
          )
  
      raise AssertionError(
          "Expected: '%s', Actual: 'None'" % expected_exception.__name__
      )
  
file_path: pyclustering/pyclustering/tests/assertion.py
imports: import numpy
label_desc: Use image node_id 10 for calling the assertion obj's underlying member method code with example usage: obj.exception(expected_exception, callable_object) without return types