'Determine the number of jobs which are going to run in parallel.
This also checks if we are attempting to create a nested parallel
loop.'

def effective_n_jobs(self, n_jobs):

    if (mp is None):
        return 1
    if mp.current_process().daemon:
        if (n_jobs != 1):
            warnings.warn('Multiprocessing-backed    parallel    loops    cannot    be    nested,    setting    n_jobs=1', stacklevel=3)
        return 1
    if (not isinstance(threading.current_thread(), threading._MainThread)):
        warnings.warn('Multiprocessing-backed    parallel    loops    cannot    be    nested    below    threads,    setting    n_jobs=1', stacklevel=3)
        return 1
    return super(MultiprocessingBackend, self).effective_n_jobs(n_jobs)
