human
I wrote the below code

    m = sp.match(split)
    if (not m):
        raise ValueError('split    must    be    a    string    of    the    form    a/b    where    a    and    b    are    ints')
    (i, t) = map(int, m.groups())
    if (not density):
        return l[(((i - 1) * len(l)) // t):((i * len(l)) // t)]
    tot = sum(density)
    density = [(x / tot) for x in density]
    def density_inv(x):
        'Interpolate    the    inverse    to    the    cumulative\n                                distribution    function    given    by    density'
        if (x <= 0):
            return 0
        if (x >= sum(density)):
            return 1
        cumm = 0
        for (i, d) in enumerate(density):
            cumm += d
            if (cumm >= x):
                break
        frac = ((d - (cumm - x)) / d)
        return ((i + frac) / len(density))
    lower_frac = density_inv(((i - 1) / t))
    higher_frac = density_inv((i / t))
    return l[int((lower_frac * len(l))):int((higher_frac * len(l)))]

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def split_list(l, split, density=None):