Need to learn how to use TrialHandler

I am trying to learn how to use TrialHandler to do some custom trial orders. For example, I need to constrain the order so that no more than 2 successive trials of a given type are presented. I realize there are many ways to do this but I think my next step is to learn how to use TrialHandler.

I found the reference material here:

https://www.psychopy.org/api/data.html#psychopy.data.TrialHandler

That page references a demo called demo_trialHandler.py. Can someone point me to that file?

I found this demo but it isn’t detailed plus it has some Javascript in there that I hope I don’t need: moving-cue.psyexp · master · VESPR / Moving Cue · GitLab

Can trialList be used to present the trials in any order? For example, a sequence like trialList[5], trialList[3], trialList[0], trialList[10], etc in that order.

Thanks in advance for your help.