code: def testSeed(self):
      def draw(seed):
          with self.cached_session():
              true_classes = constant_op.constant(
                  [[1, 2], [0, 4], [3, 3]], dtype=dtypes.int64
              )
              (
                  sampled,
                  _,
                  _,
              ) = candidate_sampling_ops.log_uniform_candidate_sampler(
                  true_classes,
                  self.NUM_TRUE,
                  self.NUM_SAMPLED,
                  True,
                  5,
                  seed=seed,
              )
              return self.evaluate(sampled)
  
      # Non-zero seed. Repeatable.
      for seed in [1, 12, 123, 1234]:
          self.assertAllEqual(draw(seed), draw(seed))
      # Seed=0 means random seeds.
      num_same = 0
      for _ in range(10):
          if np.allclose(draw(None), draw(None)):
              num_same += 1
      # Accounts for the fact that the same random seed may be picked
      # twice very rarely.
      self.assertLessEqual(num_same, 2)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/random/candidate_sampler_ops_test.py
imports: import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import candidate_sampling_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the RangeSamplerOpsTest obj's underlying member method code with example usage: obj.testSeed() and returns: self