def _permsForSwiping(self):
        # We use an identity permutation to generate the permutations from by
        # slicing correctly.
        identity = scipy.array(list(range(self.sequenceLength)))
        identity.shape = tuple(s // b for s, b in zip(self.shape, self.blockshape))
        permutations = []
        # Loop over all possible directions: from each corner to each corner
        for direction in crossproduct([('+', '-')] * self.timedim):
            axises = []
            for _, axisdir in enumerate(direction):
                # Use a normal complete slice for forward...
                if axisdir == '+':
                    indices = slice(None, None, 1)
                # ...and a reversed complete slice for backward
                else:
                    indices = slice(None, None, -1)
                axises.append(indices)
            permutations.append(operator.getitem(identity, axises).flatten())
        return permutations
Return the correct permutations of blocks for all swiping direction.
dataset/ETHPy150Open pybrain/pybrain/pybrain/structure/networks/mdrnn.py/_MultiDirectionalMdrnn._permsForSwiping