MCPcopy Index your code
hub / github.com/numpy/numpy / comp_state

Function comp_state

numpy/random/tests/test_smoke.py:61–74  ·  view source on GitHub ↗
(state1, state2)

Source from the content-addressed store, hash-verified

59
60
61def comp_state(state1, state2):
62 identical = True
63 if isinstance(state1, dict):
64 for key in state1:
65 identical &= comp_state(state1[key], state2[key])
66 elif type(state1) is not type(state2):
67 identical &= type(state1) is type(state2)
68 elif (isinstance(state1, (list, tuple, np.ndarray)) and isinstance(
69 state2, (list, tuple, np.ndarray))):
70 for s1, s2 in zip(state1, state2):
71 identical &= comp_state(s1, s2)
72 else:
73 identical &= state1 == state2
74 return identical
75
76
77def warmup(rg, n=None):

Callers 11

test_initMethod · 0.85
test_advanceMethod · 0.85
test_jumpMethod · 0.85
test_entropy_initMethod · 0.85
test_seedMethod · 0.85
test_pickleMethod · 0.85
test_seed_arrayMethod · 0.85
test_uniform_floatMethod · 0.85
test_gamma_floatsMethod · 0.85
test_normal_floatsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…