dohlee.thread module — dohlee 0.1.10 documentation

# dohlee.thread module

`dohlee.thread.` `imap_helper`(args)

  Helper function for imap. This is needed since built-in multiprocessing library does not have istarmap function. If packed arguments are passed, it unpacks the arguments and pass through the function. Otherwise, it just pass the argument through the given function.

  Attributes:
    args: Tuple of two arguments, user-defined function and arguments to pass through.

`dohlee.thread.` `threaded`(func, params, processes, progress=False, progress_type='tqdm')

  Generate results of the function with given parameters with threads.

  Attributes:

    func (function): Function to be executed. params (iterable): A list of parameters. processes (int): Number of processes to work on. progress (bool): if True, show progress bar. progress_type (str): ‘tqdm’ - Default tqdm.tqdm will be used for progress bar.

    > ‘tqdm_notebook’ - tqdm.tqdm_notebook will be used for progress bar.