code: def test_exception_raising():
      def worker_error_fn():
          if "worker" in os.environ["KERASTUNER_TUNER_ID"]:
              raise ValueError("Found a worker error")
  
      with pytest.raises(ValueError, match="Found a worker error"):
          mock_distribute.mock_distribute(
              worker_error_fn, num_workers=2
          )
  
      def chief_error_fn():
          if "chief" in os.environ["KERASTUNER_TUNER_ID"]:
              raise ValueError("Found a chief error")
  
      with pytest.raises(ValueError, match="Found a chief error"):
          mock_distribute.mock_distribute(chief_error_fn, num_workers=2)
  
imports: import os
  import time
  import pytest
  from keras_tuner.test_utils import mock_distribute
label_desc: Use image node_id 2 for calling a global function with example usage: test_exception_raising() without return types