original_docstring: 
      pick cnt boxes beyond iou_thresh from boxes_filtered
    
docstring: pick cnt boxes beyond iou_thresh from boxes_filtered
docstring_tokens: pick cnt boxes beyond iou_thresh from boxes_filtered
code: def pick_boxes(boxes_filtered, img_shape, iou_thresh, cnt):
    """
      pick cnt boxes beyond iou_thresh from boxes_filtered
    """
    box_set = []
    ctrl = 0
  
    while cnt:
      box_target = boxes_filtered[npr.randint(boxes_filtered.shape[0]), :]
      ok = 0
  
      while not ok:
        x1, x2 = _pick_2(box_target[0], box_target[2], img_shape[1], iou_thresh)
        y1, y2 = _pick_2(box_target[1], box_target[3], img_shape[0], iou_thresh)
  
        if iou((x1, y1, x2, y2), box_target.reshape(-1, 4)) > iou_thresh:
          box_set.append([x1, y1, x2, y2])
          ok = 1
          cnt -= 1
        
        ctrl += 1
        if ctrl > 1000:
          raise Exception('Infinite loop...')
  
    return box_set
code_tokens: def pick_boxes ( boxes_filtered , img_shape , iou_thresh , cnt ) : box_set = [ ] ctrl = 0 while cnt : box_target = boxes_filtered [ npr . randint ( boxes_filtered . shape [ 0 ] ) , : ] ok = 0 while not ok : x1 , x2 = _pick_2 ( box_target [ 0 ] , box_target [ 2 ] , img_shape [ 1 ] , iou_thresh ) y1 , y2 = _pick_2 ( box_target [ 1 ] , box_target [ 3 ] , img_shape [ 0 ] , iou_thresh ) if iou ( ( x1 , y1 , x2 , y2 ) , box_target . reshape ( - 1 , 4 ) ) > iou_thresh : box_set . append ( [ x1 , y1 , x2 , y2 ] ) ok = 1 cnt -= 1 ctrl += 1 if ctrl > 1000 : raise Exception ( 'Infinite loop...' ) return box_set
short_docstring: pick cnt boxes beyond iou_thresh from boxes_filtered
short_docstring_tokens: pick cnt boxes beyond iou_thresh from boxes_filtered
comment: """
      pick cnt boxes beyond iou_thresh from boxes_filtered
    """