code: def test_no_port_error():
      with mock.patch.object(
          os, "environ", mock_distribute.MockEnvVars()
      ):
          os.environ["KERASTUNER_ORACLE_IP"] = "127.0.0.1"
          os.environ["KERASTUNER_TUNER_ID"] = "worker0"
          with pytest.raises(
              RuntimeError, match="KERASTUNER_ORACLE_PORT"
          ):
              utils.has_chief_oracle()
  
imports: import os
  from unittest import mock
  import pytest
  from keras_tuner.distribute import utils
  from keras_tuner.test_utils import mock_distribute
label_desc: Use image node_id 1 for calling a global function with example usage: test_no_port_error() without return types