code: def from_format(cls, file_format: str) -> str:
      if file_format == SerializationFormats.PICKLE:
          return FileFormats.PKL
      elif file_format == SerializationFormats.JSON:
          return FileFormats.JSON
      elif file_format == SerializationFormats.TEXT:
          return FileFormats.TXT
      else:
          raise ValueError(f"Unknown format: {file_format}")
  
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 the SerializationExtensions obj's underlying member method code with example usage: obj.from_format(cls, file_format) and returns: FileFormats, FileFormats, FileFormats