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

    if (max_program_len == None):
        max_program_len = DEFAULT_MAX_PROGRAM_LEN
    if (deepcopy_inputs not in (0, 1, False, True)):
        raise ValueError('deepcopy_inputs    should    be    bool', deepcopy_inputs)
    node = as_apply(expr)
    topnode = node
    if (memo is None):
        memo = {}
    else:
        memo = dict(memo)
    node_inputs = {}
    node_list = []
    dfs(node, node_list, seqset=node_inputs)
    if memo_gc:
        clients = {}
        for aa in node_list:
            clients.setdefault(aa, set())
            for ii in node_inputs[aa]:
                clients.setdefault(ii, set()).add(aa)
        def set_memo(k, v):
            assert (v is not GarbageCollected)
            memo[k] = v
            for ii in node_inputs[k]:
                if all(((iic in memo) for iic in clients[ii])):
                    memo[ii] = GarbageCollected
    else:
        def set_memo(k, v):
            memo[k] = v
    todo = deque([topnode])
    while todo:
        if (len(todo) > max_program_len):
            raise RuntimeError('Probably    infinite    loop    in    document')
        node = todo.pop()
        if print_trace:
            print('rec_eval:print_trace', len(todo), node.name)
        if (node in memo):
            continue
        if (node.name == 'switch'):
            switch_i_var = node.pos_args[0]
            if (switch_i_var in memo):
                switch_i = memo[switch_i_var]
                try:
                    int(switch_i)
                except:
                    raise TypeError('switch    argument    was', switch_i)
                if ((switch_i != int(switch_i)) or (switch_i < 0)):
                    raise ValueError('switch    pos    must    be    positive    int', switch_i)
                rval_var = node.pos_args[(switch_i + 1)]
                if (rval_var in memo):
                    set_memo(node, memo[rval_var])
                    continue
                else:
                    waiting_on = [rval_var]
            else:
                waiting_on =...

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

def rec_eval(expr, deepcopy_inputs=False, memo=None, max_program_len=None, memo_gc=True, print_trace=False, print_node_on_error=True):