this is a psychopy randomization technique I used for some of my experiments.

I’ll try to provide more detailed annotations in the future. Meanwhile, let me know if you have any suggestions or questions.

The codes can be found on my Github page
https://github.com/lokigao/randomcodes/blob/master/PsychopyRandomizationCodes.py