code: function() {
                  var ctxArgs = Array.prototype.slice.call(arguments, 0);
                  return function(err, data) {
                      if (!err) {
                          var args = Array.prototype.slice.call(arguments, 1);
                          deferredObject.resolve.apply(null,
                              ctxArgs.concat(args));
                      } else {
                          deferredObject.reject.apply(null,
                              ctxArgs.concat([err]));
                      }
                  };
              }
docs: /*
  Generates a callback that resolves/rejects the deferred object
  based on the success/failure of an operation, determined by the
  first argument in.