def permute(self, permute_list):                                 #(Q1)
        if max(permute_list) > self.size -1:                         #(Q2)
            raise ValueError( "Bad permutation index" )              #(Q3)
        outlist = []                                                 #(Q4)
        i = 0                                                        #(Q5)
        while ( i < len( permute_list ) ):                           #(Q6)
            outlist.append( self[ permute_list[i] ] )                #(Q7)
            i += 1                                                   #(Q8)
        return BitVector( bitlist = outlist )                        #(Q9)
Permute a bit vector according to the indices
dataset/ETHPy150Open networkdynamics/zenlib/src/zen/util/bitvector.py/BitVector.permute