Change Grasshopper file to Ghpython

Hi!
Does anyone know how I can change this Grasshopper components to GhPython components?
I don´t really know where to start and what to write in the python script.

Thankfull for any help!
Grasshopper tunnel.gh (34.4 KB)

I finally figured it out! :smiley:

I also like to know. Would you like to share the method you have found?