Resolve the promise.
352030
def resolve(self, *pargs, **kwargs):
        """"""
        self._cached = (pargs, kwargs)
        self._try_then()
472760
function (promise){
    		promise.success = function (fn) {
	            promise.then(fn);
	            return promise;
	        };

	        promise.error = function (fn) {
	            promise.then(null, fn);
	            return promise;
	        };
    	}
138439
function() {
        return new Promise(function(resolve, reject) {
            exec("find . ! -name '" + __filename.split('/').pop() + "' -iname '*\.js' | xargs grep 'CRUD.Entity.call(this);' -isl", {
                timeout: 3000,
                cwd: process.cwd()
            }, function(err, stdout, stdin) {
                var results = stdout.trim().split('\n');
                for (var i = 0; i < results.length; i++) {
                    eval(fs.readFileSync(results[i]) + '');
                }
                resolve(Object.keys(CRUD.entities));
            });
        });
    }
825425
function promisePrompt(questions) {
    return new Promise(function(resolve, reject) {
        inquirer.prompt(questions, function(results) {
            resolve(results);
        });
    });
}
1297280
function() {
        return new Promise(function(resolve, reject) {
            try {
                let files;
                if(fileUtils.fileExists(resourceDir)) {
                    files = fs.readdirSync(resourceDir);
                    files = _.uniqBy(files, function (f) {
                        return path.basename(f, '.' + rc.tools.spec.file_ext);
                    }).map(function(f) { return path.join(resourceDir, f);});
                }
                if(!files) files = [];
                resolve(files);
            } catch (err) {
                reject(err);
            }
        }).then(function(files) {
            return promiseUtils.chain(rc.tools.inspect, function(err) {
                console.error(err);
                return false;
            })(files);
        });
    }
72557
function fulfillPromise(promise, value) {
  if (promise.state !== PENDING) {return;}

  setValue(promise, value);
  setState(promise, UNFULFILLED);

  setImmediate(function() {
    setState(promise, FULFILLED);
    invokeFunctions(promise);
  });
}
1088131
function resolverMiddleware (resolver) {
  return function (req, res, next) {
    try {
      const { source, args, context, info } = req
      const nonCircularReq = _.omit(req, [ 'context' ])
      const ctx = _.assign({}, context, { req: nonCircularReq, res, next })
      const value = resolver(source, args, ctx, info)

      // return a resolved promise
      return Promise.resolve(value)
        .then(result => {
          req.result = result
          return next()
        })
        .catch(next)
    } catch (err) {
      return next(err)
    }
  }
}
957339
def do_resolve(self, line):
        """"""
        pid, = self._split_args(line, 1, 0)
        self._command_processor.resolve(pid)
112661
function() {
        var self = this;

        return new Promise(function(resolve, reject) {
            var config = {};

            for (var i = 0; i < self._modules.length; i++) {
                var module = self._modules[i];

                var storedModule = config[module.name] = {
                    dependencies: module.dependencies
                };

                if (module.condition) {
                    storedModule.condition = module.condition;
                }

                if (!self._options.ignorePath) {
                    if (module.fullPath) {
                        storedModule.fullPath = upath.toUnix(module.fullPath);
                    } else {
                        var dirname = path.dirname(module.name);

                        var modulePath = module.path || (dirname !== '.' ? dirname + '/' + module.file : module.file);

                        storedModule.path = upath.toUnix(modulePath);
                    }
                }
            }

            resolve(config);
        });
    }
222819
def then(self, success=None, failure=None):
        
        rv = Promise()

        def on_success(v):
            try:
                rv.resolve(success(v))
            except Exception as e:
                rv.reject(e)

        def on_failure(r):
            try:
                rv.resolve(failure(r))
            except Exception as e:
                rv.reject(e)

        self.done(on_success, on_failure)
        return rv
379780
function fulfilled(value) {
            var p = new Promise();
            p.then = then;
            states.fulfill(p, value);
            return p;

            function then(onFulfilled) {
                try {
                    return resolve(typeof onFulfilled == 'function' ? onFulfilled(value) : value);
                } catch (e) {
                    return rejected(e);
                }
            }
        }
1198768
function handle (fn) {
	return function (...args) {
		return new Promise((resolve) => {
			fn.bind(this)(...args, function (err, result) {
				/* istanbul ignore if */
				if (err) {
					debug(err);
				} else {
					resolve(result);
				}
			});
		});
	};
}
1362705
function resolve(vResult0) {
			var fnThen;

			if (vResult0 === that) {
				reject(new TypeError("A promise cannot be resolved with itself."));
				return;
			}
			if (vResult0 instanceof SyncPromise) {
				if (vResult0.isFulfilled()) {
					resolve(vResult0.getResult());
					return;
				} else if (vResult0.isRejected()) {
					vResult0.caught(); // might have been uncaught so far
					reject(vResult0.getResult());
					return;
				} else {
					vResult0.caught(); // make sure it will never count as uncaught
					vResult0 = vResult0.getResult(); // unwrap to access native thenable
				}
			}

			iState = 0;
			vResult = vResult0;
			if (hasThen(vResult)) {
				try {
					fnThen = vResult.then;
				} catch (e) {
					// 2.3.3.2. If retrieving the property x.then results in a thrown exception e,
					// reject promise with e as the reason.
					reject(e);
					return;
				}
				if (typeof fnThen === "function") {
					call(fnThen.bind(vResult), resolve, reject);
					return;
				}
			}
			iState = 1;
			if (fnResolve) {
				fnResolve(vResult);
				fnReject = fnResolve = null; // be nice to the garbage collector
			}
		}
1093050
function resolveValue () {
    // promise to resolve with value
    var promise
    // resolve string value
    if (typeof this.value === 'string') {
        promise = this.resolveString()
    }
    // resolve array value
    else if (Array.isArray(this.value)) {
        // resolve array of objects
        if (this.isObjectArray) {
            promise = this.resolveObjectArray()
        }
        // resolve array of id strings
        else {
            promise = this.resolveArray()
        }
    }
    // resolve object value
    else if (this.value && typeof this.value === 'object') {
        promise = this.resolveObject()
    }
    // do nothing
    else {
        return Promise.resolve()
    }
    // wait for promise to resolve then set value in data
    return promise.then(value => {
        // set resolved value
        _.set(this.data, this.setProperty, value)
    })
}
586169
function init(resolver) {
			var handler = new Pending();

			try {
				resolver(promiseResolve, promiseReject, promiseNotify);
			} catch (e) {
				promiseReject(e);
			}

			return handler;

			/**
			 * Transition from pre-resolution state to post-resolution state, notifying
			 * all listeners of the ultimate fulfillment or rejection
			 * @param {*} x resolution value
			 */
			function promiseResolve (x) {
				handler.resolve(x);
			}
			/**
			 * Reject this promise with reason, which will be used verbatim
			 * @param {Error|*} reason rejection reason, strongly suggested
			 *   to be an Error type
			 */
			function promiseReject (reason) {
				handler.reject(reason);
			}

			/**
			 * @deprecated
			 * Issue a progress event, notifying all progress listeners
			 * @param {*} x progress event payload to pass to all listeners
			 */
			function promiseNotify (x) {
				handler.notify(x);
			}
		}
790246
function() {
  return Promise.resolve()
  .then(function() { return npm.loadAsync(); })
  .then(function(npm) {
    npm.config.set('spin', false);
    npm.config.set('global', true);
    npm.config.set('depth', 0);
    return Promise.promisify(npm.commands.list)([], true);
  })
  .then(function(data) { return data; });
}
923411
function () {
				var that = this;
				return Promise.resolve().then(function () {
					var oCfg = sap.ui.getCore().getConfiguration();
					if (!oCfg.isUI5CacheOn()) {
						safeClearInstance(that);
						sap.ui.getCore().getConfiguration().setUI5CacheOn(true);
					}
					return Promise.resolve();
				});
			}