I'm learning python and I'm doing some experiment with the module graph_tool. Since the function all_circuits could take a long time to calculate all the cycles, is there a way to stop the function (for example after "X" seconds or after the iterator reaches a certain size) and continue the execution of the script? Thanks