Setting nonlinear subdivision level through script


I have ParaView 5.6 and a bunch of pvtu files on a server to visualise. These contain high order data and I want to extract data over a line using a script.

I have a working script for the default case (linear cells). According to this wiki page, Nonlinear Subdivision Level has to be manually set to visualise the high order data.

So my question is how can I do this setting through a paraview-python script?

P.S. I cannot use Trace Recorder for this on my personal device because it doesn’t support the required paraview version for high order visualisation.