def get_enum_key(key, choices):
if key in choices:<EOL><INDENT>return key<EOL><DEDENT>keys = [k for k in choices if k.startswith(key)]<EOL>if len(keys) == <NUM_LIT:1>:<EOL><INDENT>return keys[<NUM_LIT:0>]<EOL><DEDENT>
Get an enum by prefix or equality