human
I wrote the below code

    def trigger(trainer):
        return (trainer.updater.iteration == 1)
    if (variable_style is None):
        variable_style = _var_style
    if (function_style is None):
        function_style = _func_style
    original_flag = [None]
    def initializer(_):
        original_flag[0] = configuration.config.keep_graph_on_report
        configuration.config.keep_graph_on_report = True
    @extension.make_extension(trigger=trigger, initializer=initializer)
    def dump_graph(trainer):
        try:
            var = trainer.observation[root_name]
            if (not isinstance(var, variable.Variable)):
                raise TypeError('root    value    is    not    a    Variable')
            cg = computational_graph.build_computational_graph([var], variable_style=variable_style, function_style=function_style).dump()
            out_path = os.path.join(trainer.out, out_name)
            with open(out_path, 'w') as f:
                f.write(cg)
        finally:
            configuration.config.keep_graph_on_report = original_flag[0]
    return dump_graph

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

def dump_graph(root_name, out_name='cg.dot', variable_style=None, function_style=None):