Open GoogleCodeExporter opened 9 years ago
I did this:
# Return max_results entities, proportionally by geocell, since there
# is no ordering.
results = []
iters = [iter(val_entities) for val_entities in entities_by_value]
iter_index = 0
while len(results) < max_results and len(iters) > 0:
iter_index = iter_index%len(iters)
current_iter = iters[iter_index]
try:
results.append(current_iter.next())
iter_index = iter_index + 1
except StopIteration:
del iters[iter_index]
return results
Original comment by elias.n...@gmail.com
on 24 Aug 2010 at 1:40
Original issue reported on code.google.com by
ryanlees...@gmail.com
on 24 Apr 2010 at 3:42