'Shutdown all mturk agents in parallel, otherwise if one mturk agent
is disconnected then it could prevent other mturk agents from completing.'

def shutdown(self):

    global shutdown_agent
    def shutdown_agent(mturk_agent):
        mturk_agent.shutdown()
    Parallel(n_jobs=len(self.agents), backend='threading')((delayed(shutdown_agent)(agent) for agent in self.agents))
