@classmethod
  def instance(cls, name, thread_count=1, idle_timeout=60):
    '''A convenience method for accessing shared instances of ``TaskQueue``.
    If ``name`` references an existing instance created with this method,
    that instance will be returned. Otherwise, a new ``TaskQueue`` will be
    instantiated with ``thread_count`` threads and the specified ``idle_timeout``
    then stored under ``name``.

    All arguments after name are ignored after the queue is created.
    '''
    if not hasattr(cls, '_task_queues'):
      cls._task_queues = {}
    try:
      return cls._task_queues[name]
    except __HOLE__:
      cls._task_queues[name] = cls(thread_count, idle_timeout, name)
      return cls._task_queues[name]
dataset/ETHPy150Open JeremyOT/Toto/toto/tasks.py/TaskQueue.instance