<s> """<STR_LIT>""" <EOL> class EnumTypeWrapper ( object ) : <EOL> """<STR_LIT>""" <EOL> DESCRIPTOR = None <EOL> def __init__ ( self , enum_type ) : <EOL> """<STR_LIT>""" <EOL> self . _enum_type = enum_type <EOL> self . DESCRIPTOR = enum_type ; <EOL> def Name ( self , number ) : <EOL> """<STR_LIT>""" <EOL> if number in self . _enum_type . values_by_number : <EOL> return self . _enum_type . values_by_number [ number ] . name <EOL> raise ValueError ( '<STR_LIT>' % ( <EOL> self . _enum_type . name , number ) ) <EOL> def Value ( self , name ) : <EOL> """<STR_LIT>""" <EOL> if name in self . _enum_type . values_by_name : <EOL> return self . _enum_type . values_by_name [ name ] . number <EOL> raise ValueError ( '<STR_LIT>' % ( <EOL> self . _enum_type . name , name ) ) <EOL> def keys ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ value_descriptor . name <EOL> for value_descriptor in self . _enum_type . values ] <EOL> def values ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ value_descriptor . number <EOL> for value_descriptor in self . _enum_type . values ] <EOL> def items ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ ( value_descriptor . name , value_descriptor . number ) <EOL> for value_descriptor in self . _enum_type . values ] </s>
