import multiprocessing as mp


def _setup_pool(n_jobs):
    """
    Set pool for multiprocessing
    ...

    Parameters
    ----------
    n_jobs      : int
                  The number of parallel jobs to run. If -1, then the number
                  of jobs is set to the number of CPU cores.
    """

    if n_jobs == -1:
        pool = mp.Pool(mp.cpu_count())
    else:
        pool = mp.Pool(n_jobs)
    return pool