code: def test_get_value_borrow(rng):
      s_rng = shared(rng)
  
      r_ = s_rng.container.storage[0]
      r_T = s_rng.get_value(borrow=True)
      r_F = s_rng.get_value(borrow=False)
  
      # the contract requires that borrow=False returns a copy
      assert r_ is not r_F
  
      # the current implementation allows for True to return the real thing
      assert r_ is r_T
  
      # either way, the rngs should all be in the same state
      if hasattr(rng, "rand"):
          assert r_.rand() == r_F.rand()
      else:
          assert r_.standard_normal() == r_F.standard_normal()
  
imports: import numpy
  import pytest
  from pytensor import shared
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_value_borrow(rng) without return types