code: def _validate_attributes(
      data_struct: dict,
      data_name: str,
      attributes: typing.Iterable[str],
  ):
      """Checks that ``attributes`` contains only valid attributes for the given
      ``data_name``. If any attributes do not exist, raise a ValueError.
      """
      invalid_attributes = [
          attr
          for attr in attributes
          if attr not in data_struct[data_name]["attributes"]
      ]
      if not invalid_attributes:
          return
  
      if len(invalid_attributes) == 1:
          values_err = f"'{invalid_attributes[0]}' is an invalid attribute for '{data_name}'"
      else:
          values_err = f"{invalid_attributes} are invalid attributes for '{data_name}'"
  
      raise ValueError(
          f"{values_err}. Valid attributes are: {data_struct[data_name]['attributes']}"
      )
  
imports: import typing
  import urllib.parse
  from concurrent.futures import FIRST_EXCEPTION, ThreadPoolExecutor, wait
  from functools import lru_cache
  from pathlib import Path
  from time import sleep
  from typing import List, Optional, Union
  from requests import get
  from pennylane.data.base import Dataset
  from pennylane.data.base.hdf5 import open_hdf5_s3
  from .foldermap import DataPath, FolderMapView, ParamArg
  from .params import DEFAULT, FULL, format_params
label_desc: Use image node_id 6 for calling a global function with example usage: _validate_attributes(data_struct, data_name, attributes) without return types