code: def posterior_to_xarray(self):
          
          data = self.posterior
          if not isinstance(data, dict):
              raise TypeError("DictConverter.posterior is not a dictionary")
  
          if "log_likelihood" in data:
              warnings.warn(
                  "log_likelihood found in posterior."
                  " For stats functions log_likelihood needs to be in sample_stats.",
                  SyntaxWarning,
              )
  
          return dict_to_dataset(data, library=None, coords=self.coords, dims=self.dims)
docs: Convert posterior samples to xarray.