def METHOD_NAME(self, assign_result: AssignResult, num_expected: int,
                **kwargs) -> Union[Tensor, ndarray]:
    """Randomly sample some negative samples.
    Args:
        assign_result (:obj:`AssignResult`): Bbox assigning results.
        num_expected (int): The number of expected positive samples
    Returns:
        Tensor or ndarray: sampled indices.
    """
    neg_inds = torch.nonzero(
        assign_result.labels[:, 0] == 0, as_tuple=False)
    if neg_inds.numel() != 0:
        neg_inds = neg_inds.squeeze(1)
    if len(neg_inds) <= num_expected:
        return neg_inds
    else:
        return self.random_choice(neg_inds, num_expected)