human
Complete the below
def make_loop_careduce(loop_orders, dtypes, loop_tasks, sub):

    ''''Make a nested loop over several arrays and associate specific code
    to each level of nesting.
    Parameters
    loop_orders : list of N tuples of length M
    Each value of each tuple can be either the index of a dimension to
    loop over or the letter \'x\' which means there is no looping to be done
    over that variable at that point (in other words we broadcast
    over that dimension). If an entry is an integer, it will become
    an alias of the entry of that rank.
    loop_tasks : list of M+1 pieces of code
    The ith loop_task is a pair of strings, the first
    string is code to be executed before the ith loop starts, the second
    one contains code to be executed just before going to the next element
    of the ith dimension.
    The last element if loop_tasks is a single string, containing code
    to be executed at the very end.
    sub: dictionary
    Maps \'lv#\' to a suitable variable name.
    The \'lvi\' variable corresponds to the ith element of loop_orders.'
    '''
assistant
#Here is the Python program you requested.
    def loop_over(preloop, code, indices, i):
        iterv = ('ITER_%i' % i)
        update = ''
        suitable_n = '1'
        for (j, index) in enumerate(indices):
            var = sub[('lv%i' % j)]
            update += ('%(var)s_iter    +=    %(var)s_jump%(index)s_%(i)s;\n' % locals())
            if (index != 'x'):
                suitable_n = ('%(var)s_n%(index)s' % locals())
        return ('\n                                %(preloop)s\n                                for    (int    %(iterv)s    =    %(suitable_n)s;    %(iterv)s;    %(iterv)s--)    {\n                                                %(code)s\n                                                %(update)s\n                                }\n                                ' % locals())
    preloops = {}
    for (i, (loop_order, dtype)) in enumerate(zip(loop_orders, dtypes)):
        for (j, index) in enumerate(loop_order):
            if (index != 'x'):
                preloops.setdefault(j, '')
                preloops[j] += (('%%(lv%(i)s)s_iter    =    (%(dtype)s*)(PyArray_DATA(%%(lv%(i)s)s));\n' % locals()) % sub)
                break
        else:
            preloops.setdefault(0, '')
            preloops[0] += (('%%(lv%(i)s)s_iter    =    (%(dtype)s*)(PyArray_DATA(%%(lv%(i)s)s));\n' % locals()) % sub)
    if (len(loop_tasks) == 1):
        s = preloops.get(0, '')
    else:
        s = ''
        for (i, (pre_task, task), indices) in reversed(list(zip(xrange((len(loop_tasks) - 1)), loop_tasks, list(zip(*loop_orders))))):
            s = loop_over((preloops.get(i, '') + pre_task), (s + task), indices, i)
    s += loop_tasks[(-1)]
    return ('{%s}' % s)