code: def pep435_enum(name):
      # Implements PEP 435 in the minimal fashion needed by SQLAlchemy
      __members__ = OrderedDict()
  
      def __init__(self, name, value, alias=None):
          self.name = name
          self.value = value
          self.__members__[name] = self
          value_to_member[value] = self
          setattr(self.__class__, name, self)
          if alias:
              self.__members__[alias] = self
              setattr(self.__class__, alias, self)
  
      value_to_member = {}
  
      @classmethod
      def get(cls, value):
          return value_to_member[value]
  
      someenum = type(
          name,
          (object,),
          {
              "__members__": __members__,
              "__init__": __init__,
              "get": get,
          },
      )
  
      # getframe() trick for pickling I don't understand courtesy
      # Python namedtuple()
      try:
          module = sys._getframe(1).f_globals.get(
              "__name__", "__main__"
          )
      except (AttributeError, ValueError):
          pass
      if module is not None:
          someenum.__module__ = module
  
      return someenum
  
imports: from __future__ import annotations
  import sys
  from .None import config
  from .None import exclusions
  from ..None import event
  from ..None import schema
  from ..None import types
  from ..orm import mapped_column
  from ..util import OrderedDict
label_desc: Use image node_id 6 for calling a global function with example usage: pep435_enum(name) and returns: someenum, value_to_member