'Determine the number of jobs which are going to run in parallel'

def effective_n_jobs(self, n_jobs):

    if (n_jobs == 0):
        raise ValueError('n_jobs    ==    0    in    Parallel    has    no    meaning')
    elif ((mp is None) or (n_jobs is None)):
        return 1
    elif (n_jobs < 0):
        n_jobs = max(((mp.cpu_count() + 1) + n_jobs), 1)
    return n_jobs
