def METHOD_NAME(task_spec, indent):
    if task_spec in done:
        return '[shown earlier] %s (%s:%s)' % (
            task_spec.name,
            task_spec.__class__.__name__,
            hex(id(task_spec))
        ) + '\n'
    done.add(task_spec)
    dump = '%s (%s:%s)' % (
        task_spec.name,
        task_spec.__class__.__name__,
        hex(id(task_spec))
    ) + '\n'
    if verbose:
        if task_spec.inputs:
            dump += indent + \
                '- IN: ' + \
                ','.join(['%s (%s)' % (t.name, hex(id(t))) for t in task_spec.inputs]) + \
                '\n'
        if task_spec.outputs:
            dump += indent + \
                '- OUT: ' + \
                ','.join(['%s (%s)' % (t.name, hex(id(t))) for t in task_spec.outputs]) + \
                '\n'
    # sub_specs = ([task_spec.spec.start] if hasattr(task_spec, 'spec') else []) + task_spec.outputs
    for i, t in enumerate(task_spec.outputs):
        dump += indent + \
            '   --> ' + \
            METHOD_NAME(t, indent + ('   |   ' if i + 1 < len(task_spec.outputs) else '       '))
    return dump