def METHOD_NAME(summary, samples=1000):
    np.random.seed(
        hash(
            summary.std + summary.mean + summary.min + summary.max
        ) % np.iinfo(np.int32).max
    )
    samples = np.random.randn(samples) * summary.std + summary.mean
    samples = np.clip(samples, a_min=summary.min, a_max=summary.max)
    (hist, edges) = np.histogram(samples)
    upper_edges = edges[1:]
    r = HistogramProto(
        min=summary.min,
        max=summary.max,
        num=len(samples),
        sum=samples.sum(),
        sum_squares=(samples * samples).sum())
    r.bucket_limit.extend(upper_edges)
    r.bucket.extend(hist)
    return r