def _label_all(rag, attr_name):
 node = rag.nodes()[0]
 new_label = rag.node[node]['labels'][0]
 for (n, d) in rag.nodes_iter(data=True):
  d[attr_name] = new_label

def _label_all ( rag , attr_name ) : node = rag . nodes ( ) [ 0 ] new_label = rag . node [ node ] [ 'labels' ] [ 0 ] for ( n , d ) in rag . nodes_iter ( data = True ) : d [ attr_name ] = new_label
assign a unique integer to the given attribute in the rag .