I have been converting all the MEL procedures from the matrix assignment into Python. It needs a lot of debugging in the parts that create the shaders and groups, but the part that creates the geometry works.
Notice the different random patterns generated with the Python.random
module compared to MEL random function.