class_docstr: Managing class for the acute evaluator process.
  
  Relevant args are parsed in the `setup_args` function above.
class_docstr_tok: ["Managing","class","for","the","acute","evaluator","process",".","Relevant","args","are","parsed","in","the","`","setup_args","`","function","above","."]
docstr: Get next task for worker.
  
  Returns the next onboarding task if worker hasn't finished them all,
  Otherwise finds a task from the queue they haven't seen
  
  If they've seen everything in the queue, spin up an
  extra task (one that was in the queue and is now saturated)
  
  :param worker_id:
      worker id
  
  :return task_data:
      A list of tasks for the worker to complete
docstr_tok: ["Get","next","task","for","worker",".","Returns","the","next","onboarding","task","if","worker","has","n't","finished","them","all",",","Otherwise","finds","a","task","from","the","queue","they","have","n't","seen","If","they","'ve","seen","everything","in","the","queue",",","spin","up","an","extra","task","(","one","that","was","in","the","queue","and","is","now","saturated",")",":","param","worker_id",":","worker","id",":","return","task_data",":","A","list","of","tasks","for","the","worker","to","complete"]
code: def get_new_task_data(self, worker_id: str) -> List[PairingsDict]:
      """
      Get next task for worker.
  
      Returns the next onboarding task if worker hasn't finished them all,
      Otherwise finds a task from the queue they haven't seen
  
      If they've seen everything in the queue, spin up an
      extra task (one that was in the queue and is now saturated)
  
      :param worker_id:
          worker id
  
      :return task_data:
          A list of tasks for the worker to complete
      """
      tasks_per_unit = self.args.blueprint.subtasks_per_unit
      # first add onboarding tasks
      task_data = self.get_onboarding_tasks(worker_id)
      logger.debug(f"Onboarding task data gotten: {len(task_data)}")
      if len(task_data) == tasks_per_unit:
          return task_data
  
      # poll the task queue for more tasks
      task_data = self._poll_task_queue(worker_id, task_data)
      logger.debug(f"Task queue data gotten: {len(task_data)}")
      if len(task_data) == tasks_per_unit:
          return task_data
  
      # top up the task_data if we don't hit the desired tasks_per_unit
      task_data = self._top_up_task_data(worker_id, task_data)
      logger.debug(f"Topped off data gotten: {len(task_data)}")
      return task_data
  
imports: import json
  import queue
  import random
  from typing import List, Any, Dict, Tuple, Set, TYPE_CHECKING
  from mephisto.utils.logger_core import get_logger
  from mephisto.abstractions.blueprint import SharedTaskState, TaskRunner
  from omegaconf import DictConfig
label_desc: Use image node_id 9 for calling the AcuteEvalRunner obj's underlying member method code with example usage: obj.get_new_task_data(worker_id) and returns: task_data, task_data, task_data