code: def test_captured_function_numpy_randomness():
      def foo(_rnd, _seed):
          return _rnd, _seed
  
      cf = create_captured_function(foo)
      assert cf.uses_randomness
      cf.logger = mock.MagicMock()
      cf.rnd = random.Random(1234)
  
      SETTINGS.CONFIG.NUMPY_RANDOM_LEGACY_API = False
      rnd, seed = cf()
      if opt.has_numpy:
          assert type(rnd) == opt.np.random.Generator
  
          SETTINGS.CONFIG.NUMPY_RANDOM_LEGACY_API = True
          rnd, seed = cf()
          assert type(rnd) == opt.np.random.RandomState
      else:
          assert type(rnd) == random.Random
  
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 4 for calling a global function with example usage: test_captured_function_numpy_randomness() and returns: _rnd,  _seed