MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / seed_random_generators

Function seed_random_generators

scripts/test_stringzilla.py:138–149  ·  view source on GitHub ↗

Seed Python and NumPy RNGs for reproducibility.

(seed_value: Optional[int] = None)

Source from the content-addressed store, hash-verified

136
137
138def seed_random_generators(seed_value: Optional[int] = None):
139 """Seed Python and NumPy RNGs for reproducibility."""
140 if seed_value is None:
141 return
142 seed(seed_value)
143 # Try to seed NumPy's random number generator
144 # This handles both NumPy 1.x and 2.x, and any import issues
145 if numpy_available:
146 try:
147 np.random.seed(seed_value)
148 except (ImportError, AttributeError, Exception):
149 pass
150
151
152def test_library_properties():

Callers 7

test_fuzzy_substringsFunction · 0.70
test_translationsFunction · 0.70
test_translations_randomFunction · 0.70
test_bytesum_randomFunction · 0.70
test_sha256Function · 0.70
test_hmac_sha256Function · 0.70
test_fuzzy_sortingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…