code: def _to_enum(enum_str: str, enum_type: Type[Enum]):
      for e in enum_type:
          if e.value == enum_str:
              return e
      raise ValueError("Unknown emum value: " + enum_str)
  
imports: from enum import Enum
  from typing import Union, Callable, Any, Dict, Optional, Type, List, Generic, TypeVar
label_desc: Use image node_id 32 for calling the FluentDict obj's underlying member method code with example usage: obj._to_enum(enum_str, enum_type) and returns: e