This error means that the function expects an instance of something, while a list was fed instead. This means that the python script is made for single instance not a list. So you can put the python script in a custom node and make it work on list of items that way or you can rewrite the script so that the script works directly from the graph with multiple items.