code: def posterior_to_xarray(self):
          
          var_names = self.pymc3.util.get_default_varnames(  # pylint: disable=no-member
              self.trace.varnames, include_transformed=False
          )
          data = {}
          for var_name in var_names:
              data[var_name] = np.array(self.trace.get_values(var_name, combine=False, squeeze=False))
          return dict_to_dataset(data, library=self.pymc3, coords=self.coords, dims=self.dims)
docs: Convert the posterior to an xarray dataset.