code: def exception(type, sample_storage, levels, threshold, ccore):
      try:
          sample = sample_storage
          if isinstance(sample_storage, str):
              sample = read_sample(sample_storage)
  
          bang_instance = bang(
              sample, levels, ccore, density_threshold=threshold
          )
          bang_instance.process()
  
      except type:
          return
  
      except Exception as ex:
          raise AssertionError(
              "Expected: '%s', Actual: '%s'" % (type, type(ex).__name__)
          )
  
      raise AssertionError("Expected: '%s', Actual: 'None'" % type)
  
file_path: pyclustering/pyclustering/cluster/tests/bang_templates.py
imports: import matplotlib
  from pyclustering.tests.assertion import assertion
  from pyclustering.cluster.bang import bang, bang_visualizer, bang_animator
  from pyclustering.utils import read_sample
label_desc: Use image node_id 4 for calling the bang_test_template obj's underlying member method code with example usage: obj.exception(type, sample_storage, levels, threshold, ccore) without return types