code: def _key_to_str(key: Union[str, Enum]) -> str:
      if isinstance(key, str):
          return key
      elif isinstance(key, Enum):
          return key.value
      else:
          raise ValueError("Unknown key type: " + str(key.__class__))
  
imports: from enum import Enum
  from typing import Union, Callable, Any, Dict, Optional, Type, List, Generic, TypeVar
label_desc: Use image node_id 31 for calling the FluentDict obj's underlying member method code with example usage: obj._key_to_str(key) and returns: key, key