def maxindices(l):
    """
    Get indices for all occurences of maximal element in list
    :param l:
    :return:
    """
    max_indices = []
    max_value = l[0] #Assume un-exhaustible iterator
    for i, v in enumerate(l):
        if v > max_value:
            max_value = v
            max_indices = [i]
        elif v == max_value:
            max_indices.append(i)
    return max_indices