code: def _test(self, gpu):
      if gpu >= 0:
          chainer.cuda.get_device_from_id(gpu).use()
          xp = chainer.cuda.cupy
      else:
          xp = np
      batch_probs = xp.asarray(
          [[0.3, 0.7], [0.8, 0.2], [0.5, 0.5], [0.0, 1.0], [1.0, 0.0]],
          dtype=np.float32,
      )
      counter = np.zeros(batch_probs.shape, dtype=batch_probs.dtype)
      for _ in range(1000):
          batch_indices = chainer.cuda.to_cpu(
              distribution.sample_discrete_actions(batch_probs)
          )
          for i in range(batch_probs.shape[0]):
              counter[i][batch_indices[i]] += 1
      np.testing.assert_allclose(
          counter / 1000, chainer.cuda.to_cpu(batch_probs), atol=0.05
      )
  
imports: import unittest
  import chainer
  from chainer import testing
  from chainer.testing import condition
  import numpy
  import scipy.stats
  from chainerrl import distribution
label_desc: Use image node_id 1 for calling the TestSampleDiscreteActions obj's underlying member method code with example usage: obj._test(gpu) without return types