def valid_choices(choices):
for key, value in choices:<EOL><INDENT>if isinstance(value, (list, tuple)):<EOL><INDENT>for key, _ in value:<EOL><INDENT>yield key<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield key<EOL><DEDENT><DEDENT>
Return list of choices's keys