code: def test_choice(self):
      sample, num_tries = _choice(num_words=1000, num_samples=50)
      assert len(set(sample)) == 50
      assert all(0 <= x < 1000 for x in sample)
      assert num_tries >= 50
  
file_path: allennlp/tests/modules/sampled_softmax_loss_test.py
imports: from typing import Tuple
  import torch
  import numpy
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.modules.sampled_softmax_loss import _choice, SampledSoftmaxLoss
  from allennlp.modules import SoftmaxLoss
label_desc: Use image node_id 1 for calling the TestSampledSoftmaxLoss obj's underlying member method code with example usage: obj.test_choice() without return types