def allindex(value, inlist):
    """
    Mathematica Positions -equivalent
    :param value:
    :param inlist: list from which to find value
    :return: all indices
    """
    # indices = []
    # idx = -1
    # while True:
    #     try:
    #         idx = qlist.index(value, idx+1)
    #         indices.append(idx)
    #     except ValueError:
    #         break
    # return indices
    return [i for i, x in enumerate(inlist) if x == value]