[MRG] random_sample can sample histograms