human
Complete this python program:
def make_allfunc(processes, predicate, func, **extra_kwargs):
assistant
#Here is the Python program you requested.

    """Return a closure representing a function that calls a
    function for every process, and returns a result
    """
    callbacks = []
    results = []
    def allfunc(processes=processes, predicate=predicate, func=func, extra_kwargs=extra_kwargs, callbacks=callbacks, results=results):
        if (not callbacks):
            for (group, process) in processes:
                name = make_namespec(group.config.name, process.config.name)
                if predicate(process):
                    try:
                        callback = func(name, **extra_kwargs)
                    except RPCError as e:
                        results.append({'name': process.config.name, 'group': group.config.name, 'status': e.code, 'description': e.text})
                        continue
                    if isinstance(callback, types.FunctionType):
                        callbacks.append((group, process, callback))
                    else:
                        results.append({'name': process.config.name, 'group': group.config.name, 'status': Faults.SUCCESS, 'description': 'OK'})
        if (not callbacks):
            return results
        for struct in callbacks[:]:
            (group, process, cb) = struct
            try:
                value = cb()
            except RPCError as e:
                results.append({'name': process.config.name, 'group': group.config.name, 'status': e.code, 'description': e.text})
                callbacks.remove(struct)
            else:
                if (value is not NOT_DONE_YET):
                    results.append({'name': process.config.name, 'group': group.config.name, 'status': Faults.SUCCESS, 'description': 'OK'})
                    callbacks.remove(struct)
        if callbacks:
            return NOT_DONE_YET
        return results
    return allfunc