code: def exp_goodness_of_fit(samples, plot=False):
      """
      Transform exponentially distribued samples to Uniform(0,1) distribution and
      assess goodness of fit via binned Pearson's chi^2 test.
  
      :param torch.Tensor samples: A vector of real-valued samples from a
          candidate distribution that should be Exponential(1)-distributed.
      :param bool plot: Whether to print a histogram. Defaults to False.
      :returns: Goodness of fit, as a p-value.
      :rtype: float
      """
      unif01_samples = samples.neg().exp()
      return unif01_goodness_of_fit(unif01_samples, plot=plot)
  
file_path: pyro/pyro/distributions/testing/gof.py
imports: import math
  import warnings
  import torch
  from .special import chi2sf
label_desc: Use image node_id 4 for calling a global function with example usage: exp_goodness_of_fit(samples, plot) and returns: unif01_goodness_of_fit