code: def test_finalize_with_exception_no_hang():
      str_out = mpiexec_execute(__file__, ["-n", "2"], [])
  
      results = re.findall("Completed with exception.", str_out)
      assert len(results) == 1
  
      results = re.findall("Completed successfully.", str_out)
      assert len(results) == 0
  
file_path: CNTK/Tests/EndToEndTests/CNTKv2Python/Examples/finalize_test.py
imports: import numpy
  import os
  import sys
  import signal
  import shutil
  import subprocess
  import re
  import pytest
  from cntk.train.distributed import Communicator, mpi_communicator
  from distributed_common import mpiexec_execute
label_desc: Use image node_id 1 for calling a global function with example usage: test_finalize_with_exception_no_hang() without return types