code: def map_enum(data: Any, type_: Type[Enum]) -> str:
      if not isinstance(data, type_):
          raise TypeError("Not a %s" % type_.__name__)
      return data.name.lower()
  
imports: from abc import ABC, abstractmethod
  from enum import Enum
  from inspect import isclass
  from itertools import chain
  from typing import Any, ClassVar, Dict, List, Optional, Sized, Type, TypeVar, Union
  import attr
label_desc: Use image node_id 2 for calling the Dumper obj's underlying member method code with example usage: obj.map_enum(data, type_) and returns: data