It seems that you want to loop over all items that are in_progress.  Could this be done using:

`for i, r in enumerate(in_progress):`

You also could delete the next line since `r` is already defined.