rejection sampling python example