code: def savestate(self, state):
          
          oldstate = np.get_printoptions()
          np.set_printoptions(threshold=1e6)
          try:
              with open(os.path.join(self._directory, 'state.txt'), 'w') as f:
                  print_(state, file=f)
          finally:
              np.set_printoptions(**oldstate)
docs: Save the sampler's state in a state.txt file.