def get_choice(value):
if value is None:<EOL><INDENT>return '<STR_LIT:null>'<EOL><DEDENT>for attr in ['<STR_LIT>', '<STR_LIT:name>']:<EOL><INDENT>if hasattr(value, attr):<EOL><INDENT>return getattr(value, attr)<EOL><DEDENT><DEDENT>return str(value)<EOL>
Gets a key to choose a choice from any value.