title: python: run a function with a timeout (and get a returned value)
body: <p>I want to run some function, foo, and get the return value, but only if it take less than T seconds to run the function. Otherwise I'll take None as an answer. </p>
  
  <p>The specific use case that created this need for me, is in running a series of sympy nonlinear solvers, which often hang. In searching the help for sympy, devs recommended not trying to do that in sympy. But, I could not find a helpful implementation that solved this problem.</p>