Is there something like a session time out in python in between lines of code or in between calling a function? Something like this:
threshold = 20
def afunction(input):
start_session
try:
do_something...
return x
except SessionTimeOut:
return y