Resolves the latch according to `options`. Computes the hypothetical max and resolves if is not met.
494643
function evaluateLatch (resolver, options) {
    var
      settlementLatch = options.settlementLatch,
      latch = options.latch,
      promise = resolver.promise,
      fulfilled = promise.fulfilled,
      pending = promise.pending,
      rejected = promise.rejected,
      settled = fulfilled + rejected,
      maxFulfilled = fulfilled + pending,
      total = fulfilled + pending + rejected;

    if (resolver.settled) {
      return resolver.settled;
    }

    if (!settlementLatch && latch >= 1 && maxFulfilled < latch
      || !settlementLatch && latch < 1 && maxFulfilled / total < latch
      || settlementLatch && latch >= 1 && total < latch
      || settlementLatch && latch < 1 && total === 0
    ) {
      resolver.settled = true;
      return resolver.reject(resolver.rejectedValues);
    }

    if (!settlementLatch && latch >= 1 && fulfilled >= latch
      || !settlementLatch && latch < 1 && fulfilled / total >= latch
      || settlementLatch && latch >= 1 && settled >= latch
      || settlementLatch && latch < 1 && settled / total >= latch
    ) {
      resolver.settled = true;
      return settlementLatch
        ? resolver.fulfill(
          resolver.fulfilledValues.concat(resolver.rejectedValues)
        ) : resolver.fulfill(resolver.fulfilledValues);
    }

    return resolver.settled;
  }
27135
def solve_limited(self, assumptions=[]):
        

        if self.minicard:
            if self.use_timer:
                 start_time = time.clock()

            # saving default SIGINT handler
            def_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_DFL)

            self.status = pysolvers.minicard_solve_lim(self.minicard, assumptions)

            # recovering default SIGINT handler
            def_sigint_handler = signal.signal(signal.SIGINT, def_sigint_handler)

            if self.use_timer:
                self.call_time = time.clock() - start_time
                self.accu_time += self.call_time

            return self.status
877508
function resolver (remainingTry, interval) {
      var result = Q.fcall(action);
      if (remainingTry <= 0) {
        return result;
      }
      // In case of failure, wait the interval, retry the action
      return result.fail(function (e) {
        return Q.delay(interval).then(function () {
          return resolver(remainingTry-1, interval*options.intervalMultiplicator);
        });
      });
    }
628608
private Option resolveOption(String opt)
    {
        opt = Util.stripLeadingHyphens(opt);
        for (Option option : options)
        {
            if (opt.equals(option.getOpt()))
            {
                return option;
            }

            if (opt.equals(option.getLongOpt()))
            {
                return option;
            }

        }
        return null;
    }
822667
def fix_config(self, options):
        
        options = super(Trigger, self).fix_config(options)

        opt = "condition"
        if opt not in options:
            options[opt] = "True"
        if opt not in self.help:
            self.help[opt] = "The (optional) condition for teeing off the tokens; uses the 'eval' method, "\
                             "ie the expression must evaluate to a boolean value; storage values placeholders "\
                             "'@{...}' get replaced with their string representations before evaluating the "\
                             "expression (string)."

        return options
694612
function _resolvePromises (opts, val) {
  opts = opts || {}
  var duplicate = opts.duplicate
  if (is(Array, val)) {
    return Promise.all(duplicate ? concat([], val) : val)
  } else if (duplicate && is(Object, val) && !is(Function, val.then)) {
    return Object.assign({}, val)
  }
  return val
}
1285221
def __clip(val, minimum, maximum):
        
        if val is None or minimum is None or maximum is None:
            return None
        if val < minimum:
            return minimum
        if val > maximum:
            return maximum
        return val
1247567
def check(self, value):
        
        if self._inclusive:
            return False if self._min <= value <= self._max else True
        else:
            return False if value > self._max or value < self._min else True
1276997
def max_values(args):
    
    return Interval(max(x.low for x in args), max(x.high for x in args))
892842
function getSolutionByNum(solutionSet, num) {
  if(solutionSet.computed.length >= num && num >= 1) {
    if(solutionSet.computed.length == num) { // If we select the last computed solution, we checked if we can compute more solutions.
      if(solutionSet.remaining !== false) {
        console.log("Checking for ambiguity #" + (num + 1));
        var lt = sns.lazyList.tail(solutionSet.remaining);
        var newSolution = getOneSolution(solutionSet.path, solutionSet.serverFileContent, lt);
        if(newSolution === false) {
          console.log("No more ambiguity");
          solutionSet.remaining = false;
        } else {
          console.log("Ambiguity #" + (num + 1) + " found");
          solutionSet.remaining = lt;
          solutionSet.computed.push(newSolution);
        }
      }
    }
    return solutionSet.computed[num - 1];
  } else {
    console.log(`Requested invalid solution number ${num}. Returning the first`)
    return solutionSet.computed[0];
  }
}
352030
def resolve(self, *pargs, **kwargs):
        """"""
        self._cached = (pargs, kwargs)
        self._try_then()
753969
public void calculateMaxFindSkip()
    {
        Map<DFAState<T>,Integer> indexOf = new NumMap<>();
        Map<DFAState<T>,Integer> skip = new NumMap<>();
        Deque<DFAState<T>> stack = new ArrayDeque<>();
        findSkip(root, indexOf, stack, new LinkedList());
        root.setAcceptStartLength(1);
    }
1174759
function(){

            var its = this.options.iterations
                ,coef = 1 / its
                ;

            for (var i = 0; i < its; i++){

                // this.shuffleConstraints();
                this.resolveDistanceConstraints( coef );
                this.resolveAngleConstraints( coef );
            }
        }
1069155
function checkOptions(options) {
                // @TODO: should we throw an error if there are incorrect options provided?
                options = _.pick(options, permittedOptions);

                let validationErrors = utils.validateOptions(options);

                if (_.isEmpty(validationErrors)) {
                    return Promise.resolve(options);
                }

                // For now, we can only handle showing the first validation error
                return Promise.reject(validationErrors[0]);
            }
1263955
@Override
    public void resolve(final ValueStack values) throws Exception
    {
        if (values.size() < 2)
            throw new ParseException("missing operand", 0);

        try
        {
            final Object rightSideResult = values.popWhatever();
            values.popWhatever();

            values.push(rightSideResult);
        } catch (final ParseException e)
        {
            e.fillInStackTrace();
            throw new Exception(toString() + "; " + e.getMessage(), e);
        }
    }
1314086
def option(opts, *args)
      long_opt_symbol = long_opt_symbol(args)
      args += Array(OptionsHelp::TEXT[long_opt_symbol])
      opts.on(*args) do |arg|
        @options[long_opt_symbol] = arg
        yield arg if block_given?
      end
    end
720436
private static boolean isBetterOption(BigDecimal bestQuality, Variant best,
                                         BigDecimal optionQuality, Variant option)
   {
      if (best == null)
         return true;
      MediaType bestType = best.getMediaType();
      MediaType optionType = option.getMediaType();
      if (bestType != null && optionType != null)
      {
         if (bestType.getType().equals(optionType.getType()))
         {
            // Same type
            if (bestType.getSubtype().equals(optionType.getSubtype()))
            {
               // Same subtype
               int bestCount = bestType.getParameters().size();
               int optionCount = optionType.getParameters().size();
               if (optionCount > bestCount)
                  return true;   // more matching parameters
               else if (optionCount < bestCount)
                  return false;   // less matching parameters
            }
            else if ("*".equals(bestType.getSubtype()))
            {
               return true;   // more specific subtype
            }
            else if ("*".equals(optionType.getSubtype()))
            {
               return false;   // less specific subtype
            }
         }
         else if ("*".equals(bestType.getType()))
         {
            return true;   // more specific type
         }
         else if ("*".equals(optionType.getType()))
         {
            return false;   // less specific type;
         }
      }

      int signum = bestQuality.compareTo(optionQuality);
      if (signum != 0)
         return signum < 0;
      return getExplicitness(best) < getExplicitness(option);
   }