code/vexptoolbox/experiment.py
def randomizeTrials(self, ignore_blocks=False, shuffle_blocks=False):
        """ Shuffle trial order globally or within blocks 

        Args:
            ignore_blocks (bool): if True, shuffle all trials 
                irrespective of their block number
            shuffle_blocks (bool): if True, randomize experimental
                blocks before randomizing trials within blocks
        """
        if self._state == STATE_RUNNING:
            raise ValueError('Cannot randomize trials while experiment is in progress!')
        else:
            self._updateBlocks()
            if self.trials is not None:
                if ignore_blocks:
                    random.shuffle(self.trials)
                    self._dlog('Trials randomized across blocks.')
                else:
                    shuffled_trials = []
                    blocklist = copy.deepcopy(self._blocks)
                    if shuffle_blocks:
                        random.shuffle(blocklist)
                    for block in blocklist:
                        btrials = self._block_trials[block]
                        random.shuffle(btrials)
                        shuffled_trials.extend(btrials)
                    self.trials = shuffled_trials
                    self._dlog('Trials randomized.')
            self._updateTrialIndices()
 Shuffle trial order globally or within blocks 

        Args:
            ignore_blocks (bool): if True, shuffle all trials 
                irrespective of their block number
            shuffle_blocks (bool): if True, randomize experimental
                blocks before randomizing trials within blocks
        
Shuffle trial order globally or within blocks
Shuffle trial order globally or within blocks
def randomizeTrials(self, ignore_blocks=False, shuffle_blocks=False):
        if self._state == STATE_RUNNING:
            raise ValueError('Cannot randomize trials while experiment is in progress!')
        else:
            self._updateBlocks()
            if self.trials is not None:
                if ignore_blocks:
                    random.shuffle(self.trials)
                    self._dlog('Trials randomized across blocks.')
                else:
                    shuffled_trials = []
                    blocklist = copy.deepcopy(self._blocks)
                    if shuffle_blocks:
                        random.shuffle(blocklist)
                    for block in blocklist:
                        btrials = self._block_trials[block]
                        random.shuffle(btrials)
                        shuffled_trials.extend(btrials)
                    self.trials = shuffled_trials
                    self._dlog('Trials randomized.')
            self._updateTrialIndices()
def randomizeTrials ( self , ignore_blocks = False , shuffle_blocks = False ) : if self . _state == STATE_RUNNING : raise ValueError ( 'Cannot randomize trials while experiment is in progress!' ) else : self . _updateBlocks ( ) if self . trials is not None : if ignore_blocks : random . shuffle ( self . trials ) self . _dlog ( 'Trials randomized across blocks.' ) else : shuffled_trials = [ ] blocklist = copy . deepcopy ( self . _blocks ) if shuffle_blocks : random . shuffle ( blocklist ) for block in blocklist : btrials = self . _block_trials [ block ] random . shuffle ( btrials ) shuffled_trials . extend ( btrials ) self . trials = shuffled_trials self . _dlog ( 'Trials randomized.' ) self . _updateTrialIndices ( )
Shuffle trial order globally or within blocks
Shuffle trial order globally or within blocks
""" Shuffle trial order globally or within blocks 

        Args:
            ignore_blocks (bool): if True, shuffle all trials 
                irrespective of their block number
            shuffle_blocks (bool): if True, randomize experimental
                blocks before randomizing trials within blocks
        """
self
ignore_blocks
if True, shuffle all trials
irrespective of their block number
if True shuffle all trials irrespective of their block number
shuffle_blocks
if True, randomize experimental
blocks before randomizing trials within blocks
if True randomize experimental blocks before randomizing trials within blocks