@contextmanager
def time_limit(minutes):
    def signal_handler(signum, frame):
        raise TimeoutException("Time limit expired")
    signal.signal(signal.SIGALRM, signal_handler)
    signal.alarm(minutes * 60)
    try:
        yield
    finally:
        signal.alarm(0)
Configure all the many options we'll need to make this happen.
dataset/ETHPy150Open Yelp/paasta/paasta_tools/bounce_lib.py/time_limit--crossover with--dataset/ETHPy150Open datadesk/django-bakery/bakery/management/commands/publish.py/Command.set_options