def combopermutations( elements_list, prefix = []):
    """
    Generator that produces ordered combinations of permutations e.g. for [[1,2],[3,4]] it will produce:
    [[1,2],[3,4]]
    [[2,1],[3,4]]
    [[1,2],[4,3]]
    [[2,1],[4,3]]

    @param elements_list: A list of lists. Each list will be a single permutation.

    @return: a different permutation it time it is called.
    """
    if 1 <= len(elements_list):
        for perm in itertools.permutations(elements_list[0]):
            yield prefix+list(perm)
    else:
        for perm in itertools.permutations(elements_list[0]):
            for perm2 in combopermutations(elements_list[1:], prefix+list(perm)):
                yield  list(perm2)
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/data/matrix/protein/cases/rmsd/autoChainMappingCase.py/combopermutations/swapped operands of `<=`