'Get the list of prompt choices that should be presented to the
user. This consists of both built-in choices and ones provided by
plugins.
The `before_choose_candidate` event is sent to the plugins, with
session and task as its parameters. Plugins are responsible for
checking the right conditions and returning a list of `PromptChoice`s,
which is flattened and checked for conflicts.
If two or more choices have the same short letter, a warning is
emitted and all but one choices are discarded, giving preference
to the default importer choices.
Returns a list of `PromptChoice`s.'

def _get_choices(self, task):

    choices = [PromptChoice(u's', u'Skip', (lambda s, t: importer.action.SKIP)), PromptChoice(u'u', u'Use    as-is', (lambda s, t: importer.action.ASIS))]
    if task.is_album:
        choices += [PromptChoice(u't', u'as    Tracks', (lambda s, t: importer.action.TRACKS)), PromptChoice(u'g', u'Group    albums', (lambda s, t: importer.action.ALBUMS))]
    choices += [PromptChoice(u'e', u'Enter    search', manual_search), PromptChoice(u'i', u'enter    Id', manual_id), PromptChoice(u'b', u'aBort', abort_action)]
    extra_choices = list(chain(*plugins.send('before_choose_candidate', session=self, task=task)))
    all_choices = (([PromptChoice(u'a', u'Apply', None)] + choices) + extra_choices)
    short_letters = [c.short for c in all_choices]
    if (len(short_letters) != len(set(short_letters))):
        duplicates = [i for (i, count) in Counter(short_letters).items() if (count > 1)]
        for short in duplicates:
            dup_choices = [c for c in all_choices if (c.short == short)]
            for c in dup_choices[1:]:
                log.warning(u"Prompt    choice    '{0}'    removed    due    to    conflict    with    '{1}'    (short    letter:    '{2}')", c.long, dup_choices[0].long, c.short)
                extra_choices.remove(c)
    return (choices + extra_choices)
