code: def test_random_sample_with_explicit_seed(device_id, precision):
      weights = AA([x for x in range(0, 10)], precision)
      identity = np.identity(weights.size)
      allow_duplicates = False  # sample without replacement
      num_samples = 5
      seed = 123
      to_dense = lambda x: times(x, identity).eval()
      result1 = to_dense(
          random_sample(weights, num_samples, allow_duplicates, seed)
      )
      result2 = to_dense(
          random_sample(weights, num_samples, allow_duplicates, seed)
      )
      result3 = to_dense(
          random_sample(
              weights, num_samples, allow_duplicates, seed + 1
          )
      )
      result4 = to_dense(
          random_sample(weights, num_samples, allow_duplicates)
      )
      assert np.allclose(result1, result2)
      assert not np.allclose(result1, result3)
      assert not np.allclose(result1, result4)
  
file_path: CNTK/bindings/python/cntk/ops/tests/random_sample_test.py
imports: from __future__ import division
  import numpy
  import pytest
  from .ops_test_utils import AA, precision
  from cntk import random_sample_inclusion_frequency, random_sample, times
label_desc: Use image node_id 4 for calling a global function with example usage: test_random_sample_with_explicit_seed(device_id, precision) without return types