code: def _test(self):
      t = self.get_timeit("from pfrl.utils.random import sample_n_k")
  
      # faster than random.sample
      t1 = self.get_timeit(
          """
  import random
  def sample_n_k(n, k):
      return random.sample(range(n), k)
  """
      )
      self.assertLess(t, t1)
  
      # faster than np.random.choice(..., replace=False)
      t2 = self.get_timeit(
          """
  import numpy as np
  def sample_n_k(n, k):
      return np.random.choice(n, k, replace=False)
  """
      )
      self.assertLess(t, t2)
  
file_path: pfrl/tests/utils_tests/test_random.py
imports: import timeit
  import unittest
  import numpy
  import pytest
  from scipy import stats
  from pfrl.utils.random import sample_n_k
label_desc: Use image node_id 2 for calling the TestSampleNKSpeed obj's underlying member method code with example usage: obj._test() without return types