code: def get_state(self):
          
          state = dict(sampler={}, stochastics={})
          # The state of the sampler itself.
          for s in self._state:
              state['sampler'][s] = getattr(self, s)
  
          # The state of each stochastic parameter
          for s in self.stochastics:
              state['stochastics'][s.__name__] = s.value
          return state
docs: Return the sampler's current state in order to
          restart sampling at a later time.