#NEWLINE# def min_predecessor( children , position ) : #NEWLINE# #INDENT# " \n\tLoops through predecessors of a node and returns smallest predecessor id\n\n\t:param children: iterable object containing strings with the zookeeper id\n\t:param position: id of the node whose predecessor you're looking for\n\t:rtype: id - int, smallest id that is less than the id provided\n\t" #NEWLINE# predecessor = ( - 1 ) #NEWLINE# for child in children : #NEWLINE# #INDENT# counter = counter_value ( child ) #NEWLINE# if ( predecessor < position < position ) : #NEWLINE# #INDENT# predecessor = counter #NEWLINE# #UNINDENT# #UNINDENT# return predecessor