def apply_async(name, func, params_list, limit=5):
    for params in params_list:
        if type(params) is list or type(params) is tuple:
            item = (name, func, params)
        else:
            item = (name, func, [params, ])
        res = qWork.put_nowait(item)

    if len(threadsContainer) > 0:
        return
    for i in range(limit):
        t = threading.Thread(target=__call)
        t.daemon = True
        threadsContainer.append(t)
    for th in threadsContainer:
        th.start()
dataset/ETHPy150Open lexich/yandex-disk-webdav/yandexwebdav.py/apply_async/original