human
Here's a good function header given the following:
I wrote the below code

    def rand_pair(l, task):
        'Random    data    pair    for    a    task.    Total    length    should    be    <=    l.'
        k = ((l - 1) / 2)
        base = 10
        if (task[0] == 'b'):
            base = 2
        if (task[0] == 'q'):
            base = 4
        d1 = [np.random.randint(base) for _ in xrange(k)]
        d2 = [np.random.randint(base) for _ in xrange(k)]
        if (task in ['add', 'badd', 'qadd']):
            res = add(d1, d2, base)
        elif (task in ['mul', 'bmul']):
            d1n = sum([(d * (base ** i)) for (i, d) in enumerate(d1)])
            d2n = sum([(d * (base ** i)) for (i, d) in enumerate(d2)])
            if (task == 'bmul'):
                res = [int(x) for x in list(reversed(str(bin((d1n * d2n)))))[:(-2)]]
            else:
                res = [int(x) for x in list(reversed(str((d1n * d2n))))]
        else:
            sys.exit()
        sep = [12]
        if (task in ['add', 'badd', 'qadd']):
            sep = [11]
        inp = (([(d + 1) for d in d1] + sep) + [(d + 1) for d in d2])
        return (inp, [(r + 1) for r in res])
    def rand_dup_pair(l):
        'Random    data    pair    for    duplication    task.    Total    length    should    be    <=    l.'
        k = (l / 2)
        x = [(np.random.randint((nclass - 1)) + 1) for _ in xrange(k)]
        inp = (x + [0 for _ in xrange((l - k))])
        res = ((x + x) + [0 for _ in xrange((l - (2 * k)))])
        return (inp, res)
    def rand_rev2_pair(l):
        'Random    data    pair    for    reverse2    task.    Total    length    should    be    <=    l.'
        inp = [((np.random.randint((nclass - 1)) + 1), (np.random.randint((nclass - 1)) + 1)) for _ in xrange((l / 2))]
        res = [i for i in reversed(inp)]
        return ([x for p in inp for x in p], [x for p in res for x in p])
    def rand_search_pair(l):
        'Random    data    pair    for    search    task.    Total    length    should    be    <=    l.'
        inp = [((np.random.randint((nclass - 1)) + 1),...

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

def init_data(task, length, nbr_cases, nclass):