Python version of compute worker