human
Solve the following python programming problem given the following code:
# Amazon c4.8xlarge
from nelpy.utils import PrettyDuration

n_cores = 36*7
n_shuff = 5000
n_samp  = 35000

print('It is estimated to take {} to score 1500 events using {} cores'. format(
    PrettyDuration(32*4*60*60/4200000 * n_shuff * n_samp / n_cores), n_cores))
print('It is estimated to take {} to score {} events using {} cores'. format(
    PrettyDuration(32*4*60*60/4200000 * n_shuff * n_samp / 1500), n_cores, n_cores))

# Etienne's local machine
from nelpy.utils import PrettyDuration

n_cores = 8
n_shuff = 5000
n_samp  = 35000

print('It is estimated to take {} to score 1500 events using {} cores'. format(
    PrettyDuration(21*4*60*60/4200000 * n_shuff * n_samp / n_cores), n_cores))
print('It is estimated to take {} to score {} events using {} cores'. format(
    PrettyDuration(21*4*60*60/4200000 * n_shuff * n_samp / 1500), n_cores, n_cores))

parallelize_by_session = False
parallelize_by_event = True

n_jobs = 8 # set this equal to number of cores
n_shuffles = 5000
n_samples = 35000
w=3 # single sided bandwidth (0 means only include bin who's center is under line, 3 means a total of 7 bins)

if parallelize_by_session:
    from joblib import Parallel, delayed 

    # A function that can be called to do work:
    def work_sessions(arg):    

        # Split the list to individual variables:
        ii, bst, tc = arg    

        scores, shuffled_scores, percentiles = nel.analysis.replay.score_Davidson_final_bst_fast(bst=bst,
                                                                                            tuningcurve=tc,
                                                                                            w=w,
                                                                                            n_shuffles=n_shuffles,
                                                                                            n_samples=n_samples)

        return (ii, scores, shuffled_scores, percentiles)

    # List of instances to pass to work():
    parallel_sessions = [(ii,...
Given the above code, generate some markdown instructions for it.
assistant
#Here is the Python program you requested.

Parallel scoring
NOTE: it is relatively easy (syntax-wise) to score each session as a parallel task, but since the Bayesian scoring takes such a long time to compute, we can be more efficient (higher % utilization) by further parallelizing over events, and not just over sessions. This further level of parallelization makes the bookkeeping a little ugly, so I provide the code for both approaches here.