def _reverse_row(self, indices):
        """ Reverses the bits in the given row. This is required for inverse
        fft (actually we perform a normal fft, but reversing the bits gives
        us an inverse fft) """
        mask = 0x1
        for j in range(self.size):
            val = 0x0
            temp = int(indices[j])  # Int is required, for making a copy
            for i in range(self.log2_size):
                t = mask & temp
                val = (val << 1) | t
                temp = temp >> 1
            indices[j] = val
 Reverses the bits in the given row. This is required for inverse
        fft (actually we perform a normal fft, but reversing the bits gives
        us an inverse fft) 
metadrive/render_pipeline/rpcore/water/gpu_fft.py