code: def test_uniform(self, rng_ctor):
      # Test that RandomStream.uniform generates the same results as numpy
      # Check over two calls to see if the random state is correctly updated.
      random = RandomStream(utt.fetch_seed(), rng_ctor=rng_ctor)
      fn = function([], random.uniform(-1, 1, size=(2, 2)))
      fn_val0 = fn()
      fn_val1 = fn()
  
      rng_seed = np.random.SeedSequence(utt.fetch_seed())
      (rng_seed,) = rng_seed.spawn(1)
  
      rng = random.rng_ctor(rng_seed)
      numpy_val0 = rng.uniform(-1, 1, size=(2, 2))
      numpy_val1 = rng.uniform(-1, 1, size=(2, 2))
  
      assert np.allclose(fn_val0, numpy_val0)
      assert np.allclose(fn_val1, numpy_val1)
  
file_path: pytensor/tests/tensor/random/test_utils.py
imports: import numpy
  import pytest
  from pytensor import config, function
  from pytensor.compile.mode import Mode
  from pytensor.graph.rewriting.db import RewriteDatabaseQuery
  from pytensor.tensor.random.utils import RandomStream, broadcast_params, supp_shape_from_ref_param_shape
  from pytensor.tensor.type import matrix, tensor
  from tests import unittest_tools
label_desc: Use image node_id 4 for calling the TestSharedRandomStream obj's underlying member method code with example usage: obj.test_uniform(rng_ctor) without return types