human
I wrote the below code

    if (model.__class__.__name__ == 'Sequential'):
        sequential_like = True
    else:
        sequential_like = True
        for v in model.nodes_by_depth.values():
            if ((len(v) > 1) or ((len(v) == 1) and (len(v[0].inbound_layers) > 1))):
                sequential_like = False
                break
    if sequential_like:
        line_length = (line_length or 65)
        positions = (positions or [0.45, 0.85, 1.0])
        if (positions[(-1)] <= 1):
            positions = [int((line_length * p)) for p in positions]
        to_display = ['Layer    (type)', 'Output    Shape', 'Param    #']
    else:
        line_length = (line_length or 100)
        positions = (positions or [0.33, 0.55, 0.67, 1.0])
        if (positions[(-1)] <= 1):
            positions = [int((line_length * p)) for p in positions]
        to_display = ['Layer    (type)', 'Output    Shape', 'Param    #', 'Connected    to']
        relevant_nodes = []
        for v in model.nodes_by_depth.values():
            relevant_nodes += v
    def print_row(fields, positions):
        line = ''
        for i in range(len(fields)):
            if (i > 0):
                line = (line[:(-1)] + '    ')
            line += str(fields[i])
            line = line[:positions[i]]
            line += ('    ' * (positions[i] - len(line)))
        print_fn(line)
    print_fn(('_' * line_length))
    print_row(to_display, positions)
    print_fn(('=' * line_length))
    def print_layer_summary(layer):
        try:
            output_shape = layer.output_shape
        except AttributeError:
            output_shape = 'multiple'
        name = layer.name
        cls_name = layer.__class__.__name__
        fields = [(((name + '    (') + cls_name) + ')'), output_shape, layer.count_params()]
        print_row(fields, positions)
    def print_layer_summary_with_connections(layer):
        'Prints    a    summary    for    a    single    layer.\n\n                                #    Arguments\n                                                layer:   ...

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

def print_summary(model, line_length=None, positions=None, print_fn=print):