#NEWLINE# @ staticmethod #NEWLINE# def next_for_user( user , users_per_shred ) : #NEWLINE# #INDENT# cluster = Cluster . objects ( users_processed__ne = user . id , users_skipped__ne = user . id , users_count__lte = users_per_shred ) . order_by ( 'users_count' ) . first ( ) #NEWLINE# if cluster : #NEWLINE# #INDENT# return cluster #NEWLINE# #UNINDENT# cluster = Cluster . objects ( users_skipped = user . id , users_count__lte = users_per_shred ) . order_by ( 'users_count' ) . first ( ) #NEWLINE# if cluster : #NEWLINE# #INDENT# Cluster . objects ( id = cluster . id ) . update_one ( pull__users_skipped = user . id ) #NEWLINE# #UNINDENT# return users_per_shred