human
I wrote the below code

    check_divisions(b)
    if (len(b) < 2):
        raise ValueError('New    division    must    be    longer    than    2    elements')
    if force:
        if (a[0] < b[0]):
            msg = 'left    side    of    the    new    division    must    be    equal    or    smaller    than    old    division'
            raise ValueError(msg)
        if (a[(-1)] > b[(-1)]):
            msg = 'right    side    of    the    new    division    must    be    equal    or    larger    than    old    division'
            raise ValueError(msg)
    else:
        if (a[0] != b[0]):
            msg = 'left    side    of    old    and    new    divisions    are    different'
            raise ValueError(msg)
        if (a[(-1)] != b[(-1)]):
            msg = 'right    side    of    old    and    new    divisions    are    different'
            raise ValueError(msg)
    def _is_single_last_div(x):
        'Whether    last    division    only    contains    single    label'
        return ((len(x) >= 2) and (x[(-1)] == x[(-2)]))
    c = [a[0]]
    d = dict()
    low = a[0]
    (i, j) = (1, 1)
    k = 0
    last_elem = _is_single_last_div(a)
    while ((i < len(a)) and (j < len(b))):
        if (a[i] < b[j]):
            d[(out1, k)] = (methods.boundary_slice, (name, (i - 1)), low, a[i], False)
            low = a[i]
            i += 1
        elif (a[i] > b[j]):
            d[(out1, k)] = (methods.boundary_slice, (name, (i - 1)), low, b[j], False)
            low = b[j]
            j += 1
        else:
            d[(out1, k)] = (methods.boundary_slice, (name, (i - 1)), low, b[j], False)
            low = b[j]
            i += 1
            j += 1
        c.append(low)
        k += 1
    if ((a[(-1)] < b[(-1)]) or (b[(-1)] == b[(-2)])):
        for _j in range(j, len(b)):
            m = (len(a) - 2)
            d[(out1, k)] = (methods.boundary_slice, (name, m), low, b[_j], False)
            low = b[_j]
            c.append(low)
            k += 1
    else:
        if (last_elem and (i < len(a))):
            d[(out1, k)]...

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

def repartition_divisions(a, b, name, out1, out2, force=False):