def METHOD_NAME(self, assign_result, num_expected, **kwargs):
    """Randomly sample some positive samples."""
    #1.首先看一下给的bboxes里面有哪些label是大于0的 得到了他们的index
    pos_inds = paddle.nonzero(assign_result.gt_inds, as_tuple=False)
    #2. 只要这个pos_inds的数目不是0个 这些就都可以是positive sample
    # 当pos_inds的数目小于num_expected(想要的sample的最大数目), 就直接用这个pos_inds
    # 反之就从这么多index里随机采样num_expected个出来
    if float(pos_inds.numel()) != 0:
        pos_inds = pos_inds.squeeze() 
    if float(pos_inds.numel()) <= num_expected:
        return pos_inds
    else:
        return self.random_choice(pos_inds, num_expected)