          remainder = len(img_list) % num_bins
  
          print("Grouping by blur...")
          bins = [[] for _ in range(num_bins)]
          image_index = 0
          for i in range(num_bins):
              for j in range(num_per_bin):
                  bins[i].append(img_list[image_index][0])
                  image_index += 1
  
 
</s> remove         image_index = 0
 </s> add  </s> remove             for j in range(num_per_bin):
                bins[i].append(img_list[image_index][0])
                image_index += 1
 </s> add             for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0]) </s> remove             for j in range(num_per_bin):
                bins[i].append(img_list[image_index][0])
                image_index += 1
 </s> add             for idx in range(num_per_bin):
                bins[i].append(img_list[idx][0]) </s> remove                 if f1encs is not None and f2encs is not None and len(
                        f1encs) > 0 and len(f2encs) > 0:
 </s> add                 if f1encs and f2encs:
          remainder = len(img_list) % num_bins
  
          print("Grouping by blur...")
          bins = [[] for _ in range(num_bins)]

          for i in range(num_bins):
              for j in range(num_per_bin):
                  bins[i].append(img_list[image_index][0])
                  image_index += 1
  
keep keep keep keep replace keep keep keep keep keep
 Sort tool bugfixes and linting 
tools/sort.py