Easiest way to apply level to Python node

Python nodes don’t have access to list levels. The idea being that you would explicitly write your code to work for the appropriate structure and replication that you need.

If you want to reuse your python code in multiple graphs (or multiple instances in the same graph) with different list levels, then you should create a custom node containing the python logic. The custom node can then use different list levels as needed.

Here is a little helper function that can apply a function across a nested list, keeping the list structure (perhaps a little off topic)

def process_list(nested_list, func=lambda x: x):
    for item in nested_list:
        if isinstance(item, list):
            yield list(process_list(item, func))
        else:
            yield func(item)