Calls the shots, based on signals
161136
def register():
    
    signals.article_generator_finalized.connect(link_source_files)
    signals.page_generator_finalized.connect(link_source_files)
    signals.page_writer_finalized.connect(write_source_files)
822884
def trapped_signals(cls, new_signal_handler):
    """"""
    try:
      previous_signal_handler = cls.reset_signal_handler(new_signal_handler)
      yield
    finally:
      cls.reset_signal_handler(previous_signal_handler)
460466
def _call(self, x, out=None):
        """"""
        if out is None:
            out = self.range.zero()
        else:
            out.set_zero()

        out[self.index] = x
        return out
438053
def _connect_signals(self, model):
        
        for signal in self._signals:
            receiver = self._signals[signal]
            signal.connect(receiver, sender=model, dispatch_uid=self._dispatch_uid(signal, model))
1360325
def signal_catcher(callback):
    """"""
    def _catch_exit_signal(sig_num, _frame):
        print('Received signal {:d} invoking callback...'.format(sig_num))
        callback()

    signal.signal(signal.SIGINT, _catch_exit_signal)
    signal.signal(signal.SIGQUIT, _catch_exit_signal)
    signal.signal(signal.SIGTERM, _catch_exit_signal)
    yield
567759
def listens_to(name, sender=None, weak=True):
    
    def decorator(f):
        if sender:
            return signal(name).connect(f, sender=sender, weak=weak)
        return signal(name).connect(f, weak=weak)
    return decorator
470743
def emit(self, signalName, *args, **kwargs):
        
        assert signalName in self, "%s is not a registered signal" % signalName
        self[signalName].emit(*args, **kwargs)
803072
def signal(value = nil)
      @mutex.synchronize do
        if waiter = @waiters.shift
          waiter << SignalConditionRequest.new(waiter.task, value)
        else
          Internals::Logger.with_backtrace(caller(3)) do |logger|
            logger.debug("Celluloid::Condition signaled spuriously")
          end
        end
      end
    end
493967
function call(handle) {
          handle.callback.apply(handle.context, args);
          called = true;
        }
1239103
def _call(self, x):
        """"""
        with self.mutex:
            result = pyshearlab.SLsheardec2D(x, self.shearlet_system)
            return np.moveaxis(result, -1, 0)
273744
function(signal, arg) {
            var slot = this._slots[signal];
            if (slot) {
                slot.call(this, arg, signal);
                return true;
            }
            return false;
        }
268321
def signals(self, signals=('QUIT', 'USR1', 'USR2')):
        ''''''
        for sig in signals:
            signal.signal(getattr(signal, 'SIG' + sig), self.handler)
278971
final void signalWork() {
        for (;;) {
            long c; int sp, i; WorkQueue v; WorkQueue[] ws;
            if ((c = ctl) >= 0L)                      // enough workers
                break;
            else if ((sp = (int)c) == 0) {            // no idle workers
                if ((c & ADD_WORKER) != 0L)           // too few workers
                    tryAddWorker(c);
                break;
            }
            else if ((ws = workQueues) == null)
                break;                                // unstarted/terminated
            else if (ws.length <= (i = sp & SMASK))
                break;                                // terminated
            else if ((v = ws[i]) == null)
                break;                                // terminating
            else {
                int ns = sp & ~UNSIGNALLED;
                int vs = v.scanState;
                long nc = (v.stackPred & SP_MASK) | (UC_MASK & (c + AC_UNIT));
                if (sp == vs && U.compareAndSwapLong(this, CTL, c, nc)) {
                    v.scanState = ns;
                    LockSupport.unpark(v.parker);
                    break;
                }
            }
        }
    }
1358181
protected function listenForSignals()
    {
        pcntl_async_signals(true);

        pcntl_signal(SIGTERM, function () {
            $this->shouldQuit = true;
        });

        pcntl_signal(SIGUSR2, function () {
            $this->paused = true;
        });

        pcntl_signal(SIGCONT, function () {
            $this->paused = false;
        });
    }
9198
def signal(e):
    
    callback = find_handler(e)
    if callback is None:
        if _activate_debugger:
            print 'Handler for error {0} not found'.format(type(e))
            traceback.print_stack()
            set_trace()
        raise e
    else:
        return callback(e)
589856
def _function_handler(function, args, kwargs, pipe):
    """"""
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    result = process_execute(function, *args, **kwargs)

    send_result(pipe, result)
414431
function processCall(msg) {
      var route = msg.route;
      if(!!route) {
        if (!!msg.body) {
          var body = msg.body.body;
          if (!body) {body = msg.body;}
          pinus.emit(route, body);
        } else {
          pinus.emit(route,msg);
        }
      } else {
          pinus.emit(msg.body.route,msg.body);
      }
    }