def sentiments_to_list(doc_id, analyzed, single_document=False):
    """Converts sentiments response to flat lists with doc_id included

    :param doc_id: Will be inserted to each row as first element
    :param analyzed: Response json from anacode api for sentiment call
    :type analyzed: list
    :param single_document: Is analysis describing just one document
    :type single_document: bool
    :return: dict -- Dictionary with one key 'sentiments' pointing to flat list
     of sentiment probabilities
    """
    sen_list = []
    for order, sentiment in enumerate(analyzed):
        row = [doc_id, 0, sentiment['sentiment_value']]
        if single_document:
            row[1] += order
        else:
            row[0] += order
        sen_list.append(row)
    return {'sentiments': sen_list}
