code: def test_validate_attributes_except(attributes, msg):
      """Test that ``_validate_attributes()`` raises a ValueError when passed
      invalid attributes."""
  
      data_struct = {"my_dataset": {"attributes": ["x", "y", "z"]}}
  
      with pytest.raises(ValueError, match=msg):
          _validate_attributes(data_struct, "my_dataset", attributes)
  
imports: import os
  from pathlib import Path, PosixPath
  from unittest.mock import MagicMock, patch
  import pytest
  import requests
  import pennylane
  import pennylane.data.data_manager
  from pennylane.data import Dataset
  from pennylane.data.data_manager import S3_URL, DataPath, _validate_attributes
label_desc: Use image node_id 20 for calling a global function with example usage: test_validate_attributes_except(attributes, msg) without return types