code: def save_attributes(
      o: Any,
      attributes: List[str],
      path: Union[str, Path],
      file_format: Union[str, List[str]] = SerializationFormats.PICKLE,
  ) -> List[Path]:
      """Save attributes from an object to disk.
  
      :param o: Object from which to pull attributes.
      :param attributes: List of attributes on the object to save.
      :param path: Path to directory on disk in which to write the attributes.
      :param file_format: File format to use when writing to disk. A list of
          file formats can be passed to assign each attribute a different
          format.
      :returns: List of paths to the saved attributes.
      """
      paths = []
      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
          )
          value = getattr(o, attribute)
          extension = SerializationExtensions.from_format(
              attribute_format
          )
          path = dir_path / f"{attribute}{extension}"
          _save_attribute(value, path, attribute_format)
          paths.append(path)
      return paths
  
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 1 for calling a global function with example usage: save_attributes(o, attributes, path, file_format) and returns: paths