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

    from blocks.bricks import BatchNormalization
    from ..filter import VariableFilter, get_application_call
    def make_variable_filter(role):
        return VariableFilter(bricks=[BatchNormalization], roles=[role])
    def get_app_call_dict(variable_filter):
        return collections.OrderedDict(((get_application_call(v), v) for v in variable_filter(computation_graph)))
    (inputs, outputs, means, stdevs) = map(get_app_call_dict, map(make_variable_filter, [INPUT, OUTPUT, BATCH_NORM_OFFSET, BATCH_NORM_DIVISOR]))
    assert (len(set([len(inputs), len(outputs), len(means), len(stdevs)])) == 1)
    app_calls = inputs.keys()
    remove = _training_mode_application_calls(app_calls)
    for app_call in app_calls:
        if (app_call in remove):
            for mapping in (inputs, outputs, means, stdevs):
                del mapping[app_call]
    replacements = []
    for app_call in inputs:
        old_output = outputs[app_call]
        op = inputs[app_call].owner.op
        assert (isinstance(op, theano.tensor.Elemwise) and isinstance(op.scalar_op, theano.scalar.basic.Identity))
        unpacked = inputs[app_call].owner.inputs[0]
        with app_call.application.brick:
            new_output = app_call.application.brick.apply(unpacked)
        new_app_call = get_application_call(new_output)
        assert new_app_call.metadata['training_mode']
        replacements.append((old_output, new_output))
    return computation_graph.replace(replacements)

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

def apply_batch_normalization(computation_graph):