code: def test_with_random_seed():
      ctx = mx.context.current_context()
      size = 100
      shape = (size,)
  
      def check_same(x, y, name):
          assert same(
              x, y
          ), f"{name} rng should give the same result with the same seed"
  
      def check_diff(x, y, name):
          assert not same(
              x, y
          ), f"{name} rng should give different results with different seeds"
  
      # generate python, numpy and mxnet datasets with the given seed
      def gen_data(seed=None):
          with random_seed(seed):
              python_data = [rnd.random() for _ in range(size)]
              np_data = np.random.rand(size)
              mx_data = mx.random.uniform(
                  shape=shape, ctx=ctx
              ).asnumpy()
          return (seed, python_data, np_data, mx_data)
  
      # check data, expecting them to be the same or different based on the seeds
      def check_data(a, b):
          seed_a = a[0]
          seed_b = b[0]
          if seed_a == seed_b and seed_a is not None:
              check_same(a[1], b[1], "python")
              check_same(a[2], b[2], "numpy")
              check_same(a[3], b[3], "mxnet")
          else:
              check_diff(a[1], b[1], "python")
              check_diff(a[2], b[2], "numpy")
              check_diff(a[3], b[3], "mxnet")
  
      # 5 tests that include a duplicated seed 1 and randomizing seed None
      seeds = [1, 2, 1, None, None]
      data = [gen_data(seed) for seed in seeds]
  
      # Add more complicated test case scenarios
      with random_seed(1):
          seeds.append(None)
          data.append(gen_data(None))
      with random_seed(2):
          seeds.append(None)
          data.append(gen_data(None))
      with random_seed():
          seeds.append(1)
          data.append(gen_data(1))
      with random_seed():
          seeds.append(2)
          data.append(gen_data(2))
      with random_seed(1):
          seeds.append(2)
          data.append(gen_data(2))
  
      num_seeds = len(seeds)
      for i in range(0, num_seeds - 1):
          for j in range(i + 1, num_seeds):
              check_data(data[i], data[j])
  
imports: import os
  import math
  import itertools
  import mxnet
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_almost_equal
  import numpy
  import random
  from common import retry, random_seed
  import scipy.stats
  import unittest
  import pytest
  from mxnet.test_utils import *
  from mxnet.base import MXNetError
  from common import assertRaises
label_desc: Use image node_id 21 for calling a global function with example usage: test_with_random_seed() and returns: seed,  python_data,  np_data,  mx_data