Callbacks stored as: [originalCallback, context, wrappedCallback]
161938
function removeCallbacks(src, callback, context) {
    return filter(src, function(event) {
      return (!callback || event[0] == callback) && (!context || context == event[1]);
    });
  }
244944
function (callback) {
            var promise = new Promise();
            this.addCallback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });

            this.addErrback(function () {
                try {
                    when(isFunction(callback) ? callback.apply(this, arguments) : callback).then(promise);
                } catch (e) {
                    promise.errback(e);
                }
            });
            return promise.promise();
        }
521245
function context(data, callback) {
    this.__data     = data;
    this.__callback = callback;
    this.__result   = [''];
    this.__current  = 0;
    this.__waiting  = 1;
    this.__contents = -1;
}
1041624
function wrapWorkAndCallback(work, callback) {
  return function(err) {
    work.stop(err);
    callback.apply(this, arguments);
  };
}
372935
def capture(context, callable_, *args, **kwargs):
    

    if not compat.callable(callable_):
        raise exceptions.RuntimeException(
                        "capture() function expects a callable as "
                        "its argument (i.e. capture(func, *args, **kwargs))"
                        )
    context._push_buffer()
    try:
        callable_(*args, **kwargs)
    finally:
        buf = context._pop_buffer()
    return buf.getvalue()
498043
function (callback) {
                var result = new Array(this.length), boundCallback = _gpfArrayBind(callback, arguments);
                _gpfArrayForEachOwn(this, function (item, index, array) {
                    result[index] = boundCallback(item, index, array);
                });
                return result;
            }
1195193
def callback(self, callback, *args, **kwds):
        
        return self << _CloseDummy(callback, args, kwds)
748591
function wrapCallback(api, span, done) {
  var fn = function(err, res) {
    if (api.enhancedDatabaseReportingEnabled()) {
      if (err) {
        // Errors may contain sensitive query parameters.
        span.addLabel('mongoError', err);
      }
      if (res) {
        var result = res.result ? res.result : res;
        span.addLabel('result', result);
      }
    }
    span.endSpan();
    if (done) {
      done(err, res);
    }
  };
  return api.wrap(fn);
}
355362
function(type, callback) {
        var list = this.__hooks[type] || [];
            list.push(callback);

        this.__hooks[type] = list;
    }
121871
def encode_callbacks(callbacks):
    """"""
    from furious.async import Async

    if not callbacks:
        return

    encoded_callbacks = {}
    for event, callback in callbacks.iteritems():
        if callable(callback):
            callback, _ = get_function_path_and_options(callback)

        elif isinstance(callback, Async):
            callback = callback.to_dict()

        encoded_callbacks[event] = callback

    return encoded_callbacks
886175
function(callback){
        callback = callback || function(){};
        var res = [], _this = this, obj = null, callbackReturn;
        this._dataCache.forEach(function(item){
            if(item.type == 'group'){
                res.push({
                    type : item.type,
                    value : _this._map(item.value, callback),
                    parent : item.parent,
                    name : item.name
                });
            }else{
                obj = clone(item);
                callbackReturn = callback.call(obj, obj, item);
                if(callbackReturn != false){
                    res.push(obj);
                }
                obj = null;
            }
        });
        res = new HostAdmin()._loadJSON(res);
        return res;
    }
179187
function(ev, callback) {
      var calls;
      if (!ev) {
        this._callbacks = {};
      } else if (calls = this._callbacks) {
        if (!callback) {
          calls[ev] = [];
        } else {
          var list = calls[ev];
          if (!list) return this;
          for (var i = 0, l = list.length; i < l; i++) {
            if (list[i] && callback === list[i][0]) {
              list[i] = null;
              break;
            }
          }
        }
      }
      return this;
    }
829786
function(callback) {
			var original = Loader.using;
			Loader.using = this;
			try{
				callback();
			}finally{
				Loader.using = original;
			}
		}
871637
def call(self, func, *args, **kwargs):
        
        wrapped = self.wrap(func)
        return wrapped(*args, **kwargs)
1320633
function (object, callback, thisArg) {
        var result;
        callback = sofa.Util.createCallback(callback, thisArg);
        sofa.Util.forOwn(object, function (value, key, object) {
            if (callback(value, key, object)) {
                result = key;
                return false;
            }
        });
        return result;
    }
1291827
def callbacks(cls, eventType=None):
        
        key = '_{0}__callbacks'.format(cls.__name__)
        try:
            callbacks = getattr(cls, key)
        except AttributeError:
            callbacks = {}
            setattr(cls, key, callbacks)

        return callbacks.get(eventType, []) if eventType is not None else callbacks
257630
function(callback) {
                var _this = this

                var initStorage = function() {
                    var obj = JSON.stringify([])
                    var _set = {}
                    _set[_this.key] = obj
                    storage.set(_set)

                    obj = JSON.parse(obj)

                    return obj
                }

                storage.get(this.key, function(items) {
                    var obj
                    if (Object.keys(items).length > 0) {
                        for (itemKey in items) {
                            obj = items[itemKey]
                            if (obj) {
                                obj = JSON.parse(obj)
                            }

                            if (obj === null || typeof obj === 'undefined') {
                                obj = initStorage()
                            } 
                            
                            if (callback) {
                                callback(obj)
                            }
                        }
                    } else {
                        obj = initStorage()
                        callback(obj)
                    }
                })
            }