def get_from_custom_distribution(random_value, bins, values): return values[np.digitize(random_value, bins)]