How to add a source (surface) of cross section to section views

What I try to do is to add sources (surfaces and corridors) to a sample line group, as you have done in this thread.

When I try to use the graph I get this message:

I understand that it has somethin to do with the indentation. But I haven’t change anything in the Python code as you can see:

I would also like to know how to sample the corridors. Thank you so much for your response. I haven’t been able to get information on this, apart from that thread. Thanks.