def _ComplexSentenceAsFlatList(complex_sentence, prefix=""):
    """Expand complex_sentence into a flat list of strings

       e.g. ['NUMBERED'] ['IDS', 'INES'] ['SOLUTION']
       to ['NUMBERED ID SOLUTION', 'NUMBERED INES SOLUTION']
    """
    results = []

    next_start = complex_sentence[1:].find('[')
    if next_start == -1:
        if complex_sentence[0] == '[':
          results.append("%s" % (prefix + complex_sentence[1:-1]))
        else:
          results.append("%s" % (prefix + complex_sentence))
        return results

    choice_set = complex_sentence[:next_start]
    rest = complex_sentence[next_start+1:]

    for choice in choice_set[1:-1].split(", "):
        results.extend(_ComplexSentenceAsFlatList(rest, prefix+choice+" "))
    return results