def variable_position_placement_generator(positions):
    '\n    Use itertools.product to generate a list of tuple with different number of 0 and 1. The length of the tuple is the\n    length of the input positions.\n    Using itertools.compress, for each output from itertools.product pairing with input positions, we generate a list of\n    positions where only those with the same index as 1 would be yielded.\n\n    :param positions: list of all identified positions for the modification on the sequence\n    '
    for i in itertools.product([0, 1], repeat=len(positions)):
        (yield list(itertools.compress(positions, i)))
Use itertools.product to generate a list of tuple with different number of 0 and 1. The length of the tuple is the
length of the input positions.
Using itertools.compress, for each output from itertools.product pairing with input positions, we generate a list of
positions where only those with the same index as 1 would be yielded.

:param positions: list of all identified positions for the modification on the sequence
def variable_position_placement_generator(positions):
    '\n    Use itertools.product to generate a list of tuple with different number of 0 and 1. The length of the tuple is the\n    length of the input positions.\n    Using itertools.compress, for each output from itertools.product pairing with input positions, we generate a list of\n    positions where only those with the same index as 1 would be yielded.\n\n    :param positions: list of all identified positions for the modification on the sequence\n    '
    for i in itertools.product([0, 1], repeat=len(positions)):
        (yield list(itertools.compress(positions, i)))