def generate_options():
used_short_options = set()<EOL>param_name = yield<EOL>while True:<EOL><INDENT>names = ['<STR_LIT>' + param_name]<EOL>for letter in param_name:<EOL><INDENT>if letter not in used_short_options:<EOL><INDENT>used_short_options.add(letter)<EOL>names.insert(<NUM_LIT:0>, '<STR_LIT:->' + letter)<EOL>break<EOL><DEDENT><DEDENT>param_name = yield names<EOL><DEDENT>
Helper coroutine to identify short options that haven't been used
    yet. Yields lists of short option (if available) and long option for
    the given name, keeping track of which short options have been previously
    used.

    If you aren't familiar with coroutines, use similar to a generator:
    x = generate_options()
    next(x)  # advance coroutine past its initialization code
    params = x.send(param_name)