def _get_and_start_work(self):
        "return (async_result, work_unit) or (None, None)"
        worker_id = nice_identifier()
        work_unit = self.task_master.get_work(worker_id, available_gb=self.available_gb())
        if work_unit is None:
            return None, None
        async_result = self.pool.apply_async(
            run_worker,
            (HeadlessWorker, self.task_master.registry.config,
             worker_id,
             work_unit.work_spec_name,
             work_unit.key),
            callback=self._finish_callback)
        return async_result, work_unit
def _get_and_start_work ( self ) : worker_id = nice_identifier ( ) work_unit = self . task_master . get_work ( worker_id , available_gb = self . available_gb ( ) ) if work_unit is None : return None , None async_result = self . pool . apply_async ( run_worker , ( HeadlessWorker , self . task_master . registry . config , worker_id , work_unit . work_spec_name , work_unit . key ) , callback = self . _finish_callback ) return async_result , work_unit
return (async_result, work_unit) or (None, None)