def get_task(self, node):
        task = self.project.next_task()
        if task is None:
            try:
                tp_id = self._tasks_pool.pop()
                task = self.project[tp_id]
            except __HOLE__:
                # project depleted and nothing in the pool,
                # looks like the application is completed.
                self.completed = True
                raise ApplicationCompletedError(self)

        task_id = task['id']
        node.task_id = task_id
        self._tasks_pool.add(task_id)
        return task
dataset/ETHPy150Open BasicWolf/kaylee/kaylee/contrib/controllers.py/SimpleController.get_task