class_docstr: A simple task queue for processing jobs in a thread pool.
class_docstr_tok: ["A","simple","task","queue","for","processing","jobs","in","a","thread","pool","."]
code: def add_task(self, task, *args, **kwargs):
      args = args or ()
      kwargs = kwargs or {}
      self.put((task, args, kwargs))
  
imports: from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence
  import itertools
  import queue
  import threading
  import time
  from typing import Any, Optional, TypeVar, Union
  import uuid
  from lit_nlp.api import types
  import numpy
label_desc: Use image node_id 2 for calling the TaskQueue obj's underlying member method code with example usage: obj.add_task(task) without return types