Python batch operation example

I’m writing python code to automatically create new and update existing tasks
Since I need to update hundreds of records I would like to use batch operations (my understanding that these can be bulked and be more efficient)
Looking for a python example