def restore_warnings_state(state):
 warnings.filters = state[:]

def restore_warnings_state ( state ) : warnings . filters = state [ : ]
restores the state of the warnings module when passed an object that was returned by get_warnings_state() .