code: def test_invalid_config_file_which_has_python_code(get_data_dir):
      invalid_config_file_path = os.path.join(
          get_data_dir, "config_file_with_code.yaml"
      )
      # no exceptions will be thrown with yaml.unsafe_load
      yaml.unsafe_load(open(invalid_config_file_path, "r"))
      # PyYAML will throw exceptions for yaml.safe_load. SageMaker Config is using
      # yaml.safe_load internally
      with pytest.raises(ConstructorError) as exception_info:
          load_sagemaker_config(
              additional_config_paths=[invalid_config_file_path],
              repeat_log=True,
          )
      assert "python/object/apply:eval" in str(exception_info.value)
  
imports: from __future__ import absolute_import
  import os
  import pytest
  import yaml
  import logging
  from mock import Mock, MagicMock, patch, call
  from sagemaker.config.config import load_local_mode_config, load_sagemaker_config, logger, non_repeating_log_factory, _DEFAULT_ADMIN_CONFIG_FILE_PATH, _DEFAULT_USER_CONFIG_FILE_PATH, _DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH
  from jsonschema import exceptions
  from yaml.constructor import ConstructorError
label_desc: Use image node_id 5 for calling a global function with example usage: test_invalid_config_file_which_has_python_code(get_data_dir) without return types