<s> """<STR_LIT>""" <EOL> import enum <EOL> from numba import types , utils <EOL> from numba . typing . templates import ( AbstractTemplate , AttributeTemplate , <EOL> signature , Registry , bound_function ) <EOL> registry = Registry ( ) <EOL> infer = registry . register <EOL> infer_global = registry . register_global <EOL> infer_getattr = registry . register_attr <EOL> @ infer_getattr <EOL> class EnumAttribute ( AttributeTemplate ) : <EOL> key = types . EnumMember <EOL> def resolve_value ( self , ty ) : <EOL> return ty . dtype <EOL> @ infer_getattr <EOL> class EnumClassAttribute ( AttributeTemplate ) : <EOL> key = types . EnumClass <EOL> def generic_resolve ( self , ty , attr ) : <EOL> """<STR_LIT>""" <EOL> if attr in ty . instance_class . __members__ : <EOL> return ty . member_type <EOL> class EnumCompare ( AbstractTemplate ) : <EOL> def generic ( self , args , kws ) : <EOL> [ lhs , rhs ] = args <EOL> if ( isinstance ( lhs , types . EnumMember ) <EOL> and isinstance ( rhs , types . EnumMember ) <EOL> and lhs == rhs ) : <EOL> return signature ( types . boolean , lhs , rhs ) <EOL> @ infer <EOL> class EnumEq ( EnumCompare ) : <EOL> key = '<STR_LIT>' <EOL> @ infer <EOL> class EnumNe ( EnumCompare ) : <EOL> key = '<STR_LIT>' </s>
