print basic statistics about a node, e.g. layer/attribute counts

def node_statistics(docgraph):
    """print basic statistics about a node, e.g. layer/attribute counts"""
    print "Node statistics\n==============="
    layer_counts = Counter()
    attrib_counts = Counter()
    for node_id, node_attrs in docgraph.nodes_iter(data=True):
        for layer in node_attrs['layers']:
            layer_counts[layer] += 1
        for attrib in node_attrs:
            attrib_counts[attrib] += 1

    print "\nnumber of nodes with layers"
    print_sorted_counter(layer_counts)
    print "\nnumber of nodes with attributes"
    print_sorted_counter(attrib_counts)