def get_messages_per_weekday(msgs):
    """Gets lists of messages for each day of the week (7 lists in a dictionary total).

    Args:
        msgs (list of MyMessage objects): Messages.

    Returns:
        A dictionary such as:
            {
                day_of_the_week (int 0-6): list off all messages sent on this day
            }
    """
    res = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: []}
    for msg in msgs:
        res[msg.date.weekday()].append(msg)
    # placing Sunday at the end of the week # turned out we don't need it...
    # for i in [0, 1, 2, 3, 4, 5]:
    #     res[i], res[(i + 6) % 7] = res[(i + 6) % 7], res[i]
    return res