def random_sleep(mean=0.3, tolerance=0.15): sleep_time = mean - tolerance + 2 * tolerance * random() sleep(sleep_time)