(state1, state2)
| 59 | |
| 60 | |
| 61 | def 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 | |
| 77 | def warmup(rg, n=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…