ensure no double-callbacks happen
5631
function cb (err) {
    if (cb.done) return
    cb.done = true
    if (err) {
      log.warn('install', 'got an error, rolling back install')
      // roll-back the install if anything went wrong
      gyp.commands.remove([ release.versionDir ], function () {
        callback(err)
      })
    } else {
      callback(null, release.version)
    }
  }
237232
function checkFunction(node) {
            const parent = node.parent;

            if (parent.type === "CallExpression") {
                callbackStack.push(node);
            }

            if (callbackStack.length > THRESHOLD) {
                const opts = { num: callbackStack.length, max: THRESHOLD };

                context.report({ node, messageId: "exceed", data: opts });
            }
        }
161938
function removeCallbacks(src, callback, context) {
    return filter(src, function(event) {
      return (!callback || event[0] == callback) && (!context || context == event[1]);
    });
  }
461280
function oneShot(callback) {
  var done = false;
  return function (err) {
    if (!done) {
      done = true;
      return callback.apply(this, arguments);
    }
    if (err) console.error(err.stack);
  }
}
22296
function clear$2(callback) {
    var self = this;
    var promise = self.ready().then(function () {
        var keyPrefix = self._dbInfo.keyPrefix;

        for (var i = localStorage.length - 1; i >= 0; i--) {
            var key = localStorage.key(i);

            if (key.indexOf(keyPrefix) === 0) {
                localStorage.removeItem(key);
            }
        }
    });

    executeCallback(promise, callback);
    return promise;
}
1209755
function () {
    var self = this;
    if (! self.invalidated) {
      // if we're currently in _recompute(), don't enqueue
      // ourselves, since we'll rerun immediately anyway.
      if (! self._recomputing && ! self.stopped) {
        requireFlush();
        pendingComputations.push(this);
      }

      self.invalidated = true;

      // callbacks can't add callbacks, because
      // self.invalidated === true.
      for(var i = 0, f; f = self._onInvalidateCallbacks[i]; i++) {
        Deps.nonreactive(function () {
          callWithNoYieldsAllowed(f, self);
        });
      }
      self._onInvalidateCallbacks = [];
    }
  }
352569
function (cb) {
            if (cb) {
                if (isPromise(cb)) {
                    cb = cb.callback;
                }
                if (this.__fired && this.__results) {
                    this.__callNextTick(cb, this.__results);
                } else {
                    this.__cbs.push(cb);
                }
            }
            return this;
        }
1192355
function() {
                        var args = Array.prototype.slice.call(arguments, 0);
                        deferredObject.reject.apply(null, ctxArgs.concat(args));
                    }
1249344
def remove_callback(obj, handle):
    """"""
    callbacks = obj._callbacks
    if callbacks is handle:
        obj._callbacks = None
    elif isinstance(callbacks, dllist):
        callbacks.remove(handle)
        if not callbacks:
            obj._callbacks = None
1238254
def repeat(self, time, function, args = []):
        """"""
        callback_id = self.tk.after(time, self._call_wrapper, time, function, *args)
        self._callback[function] = [callback_id, True]
151983
function (callback) {
                var self = this;
                flow()
                    .seq(function (cb) {
                        self.$handlers.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$authenticationService.stop(function () {
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$filters.stop(function () {
                            // ignore errors during stop
                            cb();
                        });
                    })
                    .seq(function (cb) {
                        self.$endPoints.shutdown(function () {
                            // ignore errors during shutdown
                            cb();
                        });
                    })
                    .exec(function (err) {
                        callback && callback(err);

                        process.stdin.end();
                    });
            }
526110
function _check(){
            if(_checkReady(target)){
                clearInterval(timeHandle);
                timeHandle = null;
                _call();

                isReady = true;
            }               
        }
460546
def _repeat(func):
    """"""
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        """Repeats the call until True is returned."""
        ret = None
        while ret is None:
            ret = func(*args, **kwargs)
        return ret
    return wrapper
563126
def remove_callback(self, callback):
        """"""
        if callback in self.callbacks:
            self.callbacks.remove(callback)
60143
def _handle_callback(self, data):
        """"""

        cb_id = data.get("id")
        args = data.get("args")
        event = self.__callbacks.pop(cb_id, None)
        if not event:
            return
        if not args:
            event.put(args)
            return
        err, info = args
        if err is None:
            event.put(info)
        else:
            LOGGER.warning("Callback returned error of %s", str(err))
            event.put(err)
167561
function(args, callInstance) {
    handlers.afterFunc({name: callInstance.name}, null, args, callInstance);
  }
1267276
def removeCallback(cls, eventType, func, record=None):
        
        callbacks = cls.callbacks()
        callbacks.setdefault(eventType, [])
        for i in xrange(len(callbacks[eventType])):
            my_func, my_record, _ = callbacks[eventType][i]
            if func == my_func and record == my_record:
                del callbacks[eventType][i]
                break