code: def write_sampler_metadata(self, sampler):
          
          self.attrs['sampler'] = sampler.name
          self[self.sampler_group].attrs['nwalkers'] = sampler.nwalkers
          # write the model's metadata
          sampler.model.write_metadata(self)
docs: Writes the sampler's metadata.