code: def test_captured_function_randomness():
      def foo(_rnd, _seed):
          try:
              return _rnd.integers(0, 1000), _seed
          except Exception:
              return _rnd.randint(0, 1000), _seed
  
      cf = create_captured_function(foo)
      assert cf.uses_randomness
      cf.logger = mock.MagicMock()
      cf.rnd = random.Random(1234)
  
      nr1, seed1 = cf()
      nr2, seed2 = cf()
      assert nr1 != nr2
      assert seed1 != seed2
  
      cf.rnd = random.Random(1234)
  
      assert cf() == (nr1, seed1)
      assert cf() == (nr2, seed2)
  
file_path: sacred/tests/test_config/test_captured_functions.py
imports: import datetime
  import mock
  import random
  import sacred.optional
  from sacred.config.captured_function import create_captured_function
  from sacred.settings import SETTINGS
label_desc: Use image node_id 3 for calling a global function with example usage: test_captured_function_randomness() and returns: _rnd,  _seed, _rnd,  _seed