MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / __enter__

Method __enter__

kernelbench/bench_kb.py:76–83  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 self._use_signal = hasattr(signal, "SIGALRM") # Unix only
75
76 def __enter__(self):
77 if self._use_signal:
78 self._prev = signal.signal(signal.SIGALRM, self._handler)
79 signal.alarm(int(self.seconds))
80 else:
81 self._timer = threading.Timer(self.seconds, self._thread_raise)
82 self._timer.start()
83 return self
84
85 def __exit__(self, *_):
86 if self._use_signal:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected