def curve_area(index, task, method, ax, runs, args):
    (xs, ys) = stack_scores(*zip(*[(r.xs, r.ys) for r in runs]))
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', category=RuntimeWarning)
        if (args.aggregate == 'std1'):
            (mean, std) = (np.nanmean(ys, (- 1)), np.nanstd(ys, (- 1)))
            (lo, mi, hi) = ((mean - std), mean, (mean + std))
        elif (args.aggregate == 'per0'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (0, 50, 100)]
        elif (args.aggregate == 'per5'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (5, 50, 95)]
        elif (args.aggregate == 'per25'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (25, 50, 75)]
        else:
            raise NotImplementedError(args.aggregate)
    color = args.colors[method]
    kw = dict(color=color, zorder=(1000 - (10 * index)), alpha=0.1, linewidths=0)
    ax.fill_between(xs, lo, hi, **kw)
    ax.plot(xs, mi, label=method, color=color, zorder=((10000 - (10 * index)) - 1))
    return (xs, mi)
def curve_area(index, task, method, ax, runs, args):
    (xs, ys) = stack_scores(*zip(*[(r.xs, r.ys) for r in runs]))
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', category=RuntimeWarning)
        if (args.aggregate == 'std1'):
            (mean, std) = (np.nanmean(ys, (- 1)), np.nanstd(ys, (- 1)))
            (lo, mi, hi) = ((mean - std), mean, (mean + std))
        elif (args.aggregate == 'per0'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (0, 50, 100)]
        elif (args.aggregate == 'per5'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (5, 50, 95)]
        elif (args.aggregate == 'per25'):
            (lo, mi, hi) = [np.nanpercentile(ys, k, (- 1)) for k in (25, 50, 75)]
        else:
            raise NotImplementedError(args.aggregate)
    color = args.colors[method]
    kw = dict(color=color, zorder=(1000 - (10 * index)), alpha=0.1, linewidths=0)
    ax.fill_between(xs, lo, hi, **kw)
    ax.plot(xs, mi, label=method, color=color, zorder=((10000 - (10 * index)) - 1))
    return (xs, mi)