#NEWLINE# @ ndb . transactional #NEWLINE# def update_counter( name ) : #NEWLINE# #INDENT# 'Increment the named counter by 1.' #NEWLINE# counter = Counter . get_by_id ( name ) #NEWLINE# if ( counter is None ) : #NEWLINE# #INDENT# counter = Counter ( id = name , count = 0 ) #NEWLINE# #UNINDENT# counter . count += 1 #NEWLINE# counter . put ( ) #NEWLINE# return counter . count