Flatten in GhPython, and Choosing Input Type in GhPython

You need to use the “Path Mapper” and morph the tree to your needs.
This is not really a ghpython problem, this is a Grasshopper question.