def convert_histories(histories):
    changes_set = dict()
    detailedHistories = []
    j = 0
    for i in range(len(histories)):
        if (histories[i].detail and (('add_rrests' in histories[i].detail) or ('del_rrests' in histories[i].detail))):
            extract_changelogs_from_a_history_entry(changes_set, histories[i], j)
            if (j in changes_set):
                detailedHistories.append(DetailedHistory(histories[i], changes_set[j]))
            else:
                detailedHistories.append(DetailedHistory(histories[i], None))
            j += 1
        else:
            detailedHistories.append(DetailedHistory(histories[i], None))
    return detailedHistories
def convert_histories(histories):
    changes_set = dict()
    detailedHistories = []
    j = 0
    for i in range(len(histories)):
        if (histories[i].detail and (('add_rrests' in histories[i].detail) or ('del_rrests' in histories[i].detail))):
            extract_changelogs_from_a_history_entry(changes_set, histories[i], j)
            if (j in changes_set):
                detailedHistories.append(DetailedHistory(histories[i], changes_set[j]))
            else:
                detailedHistories.append(DetailedHistory(histories[i], None))
            j += 1
        else:
            detailedHistories.append(DetailedHistory(histories[i], None))
    return detailedHistories