code: def _get_enum(name):
      
      eid = idaapi.get_enum(name)
      if eid == idaapi.BADADDR:
          raise exceptions.EnumNotFound('Enum "{}" does not exist.'.format(name))
      return eid
docs: Get an existing enum ID