def _parameter_samples_from_gibbs_posterior(model, posterior_samples):
  """Extracts samples of model parameters from Gibbs posterior samples."""
  posterior_samples_dict = posterior_samples._asdict()
  get_param = lambda param_name: posterior_samples_dict[  # pylint: disable=g-long-lambda
      [k for k in posterior_samples_dict if k in param_name][0]]
  return [get_param(param.name) for param in model.parameters]