Move up to line 614 and replace the line:
createOrUpdate = kwargs.get('createOrUpdate', True)

with this block.