Python versions of some of the codes used in RMT4