code: def load_attributes(
      o: Any,
      attributes: List[str],
      path: Union[str, Path],
      file_format: Union[str, List[str]] = SerializationFormats.PICKLE,
      fail_on_missing: bool = True,
  ) -> None:
      """Load attributes from disk and save to an existing object.
  
      :param o: Object on which to save the loaded attributes.
      :param attributes: List of attributes to load to the object.
      :param path: Path to directory on disk where attributes are saved.
      :param file_format: File format to use when loading attributes from
          disk. A list of file formats can be passed to assign each
          attribute a different format.
      :param fail_on_missing: Whether to raise an exception if an attribute
          was not found.
      """
      dir_path = Path(path)
      is_format_list = isinstance(file_format, list)
      for i, attribute in enumerate(attributes):
          attribute_format = (
              file_format[i] if is_format_list else file_format
          )
          extension = SerializationExtensions.from_format(
              attribute_format
          )
          path = dir_path / f"{attribute}{extension}"
          if not fail_on_missing and (
              not path.exists() or not path.is_file()
          ):
              continue
          value = _load_attribute(path, attribute_format)
          setattr(o, attribute, value)
  
file_path: responsible-ai-toolbox/responsibleai/responsibleai/_tools/shared/attribute_serialization.py
imports: import json
  import pickle
  import warnings
  from pathlib import Path
  from typing import Any, List, Union
  from responsibleai._internal.constants import FileFormats
label_desc: Use image node_id 3 for calling a global function with example usage: load_attributes(o, attributes, path, file_format, fail_on_missing) without return types