Returns a Position object that represents percentage%-far-of-the-way
        through the larger task, as specified by this query.

        @param percentage    a number between 0 and 100.
558591
def compute_percentile(self, percentage):
        
        all_patches = self.get_all_patches()
        return all_patches[
            int(len(all_patches) * percentage / 100)
        ].start_position
1368284
public void setSecondaryProgress(float percent){
		if(mCircular)
			((CircularProgressDrawable)mProgressDrawable).setSecondaryProgress(percent);
		else
			((LinearProgressDrawable)mProgressDrawable).setSecondaryProgress(percent);
	}
1167788
public static function percentage(float $n, int $precision = 0): string
    {
        return self::$locale->percent(round($n, $precision + 2));
    }
506907
def percentage_distance(cls, highmark, current):
        """"""
        highmark = int(highmark)
        current = int(current)
        if highmark > 0:
            return round(
                (highmark - current) * 100.0 / highmark,
                2,
            )
        else:
            return 0.0
49174
def set_current_operation_progress(self, percent):
        
        if not isinstance(percent, baseinteger):
            raise TypeError("percent can only be an instance of type baseinteger")
        self._call("setCurrentOperationProgress",
                     in_p=[percent])
594585
public static function toPercentage($value, bool $withSymbol = true, $precision = 0): string
    {
        return self::percentageFormat(100 * (float) $value, $withSymbol, $precision);
    }
226026
def sort_by_distance_percentage(cls, consumer_offsets_metadata):
        """"""
        sorted_offsets = sorted(
            list(consumer_offsets_metadata.items()),
            key=lambda topic_offsets1: sum(
                [cls.percentage_distance(o.highmark, o.current) for o in topic_offsets1[1]]
            )
        )
        return OrderedDict(sorted_offsets)
284806
protected String calcRatioHeightPercentage(double width, double height) {

        double p = Math.round((height / width) * 10000000.0) / 100000.0;
        return String.valueOf(p) + "%";
    }
1241086
def log_percent(self):
        
        done = self.total - self.todo
        percent = int(float(done) / self.total * 100)
        if not hasattr(self, 'prev_percent'):  # first time
            self.prev_percent = 0
            self.progress('Sent %s of data in %d %s task(s)',
                          humansize(self.sent.sum()), self.total, self.name)
        elif percent > self.prev_percent:
            self.progress('%s %3d%% [of %d tasks]',
                          self.name, percent, len(self.tasks))
            self.prev_percent = percent
        return done
852993
public final Position getPositionAlongPath(Position position, double proportion) {

        if (proportion >= 0 && proportion <= 1) {

            // Get bearing degrees for course
            double courseDegrees = this.getBearingDegrees(position);

            // Get distance from position arg and this objects location
            double distanceKm = this.getDistanceToKm(position);

            // Predict the position for a proportion of the course
            // where this object is the start position and the arg
            // is the destination position.
            Position retPosition = this.predict(proportion * distanceKm, courseDegrees);

            return retPosition;
        } else
            throw new RuntimeException("Proportion must be between 0 and 1 inclusive");
    }
383014
def _percent_to_integer(percent):
    
    num = float(percent.split('%')[0]) / 100.0 * 255
    e = num - math.floor(num)
    return e < 0.5 and int(math.floor(num)) or int(math.ceil(num))
215624
private static double percentageWordsWithThreeSyllables(String strText) {
        int intWordCount = wordCount(strText);
        int intLongWordCount = wordsWithThreeSyllables(strText);
        double percentage = ((intLongWordCount / (double)intWordCount) * 100.0);
        return percentage;
    }
45030
def percentOfTotal(self, value, values):
        
        try:
            return float(values.index(value) + 1) / len(values)
        except (ZeroDivisionError, ValueError):
            return 0.0
382468
def percentile(values, percent):
    
    N = sorted(values)
    if not N:
        return None
    k = (len(N) - 1) * percent
    f = int(math.floor(k))
    c = int(math.ceil(k))
    if f == c:
        return N[int(k)]
    d0 = N[f] * (c - k)
    d1 = N[c] * (k - f)
    return d0 + d1
863818
public static <T> Collector<T, ?, Optional<Double>> percentRank(T value, Comparator<? super T> comparator) {
        return percentRankBy(value, t -> t, comparator);
    }
651169
public Result getResult(boolean percentage)
    {
        float p = A_cap_B_size / (float) B_size;
        float r = A_cap_B_size / (float) A_size;
        if (percentage)
        {
            p *= 100;
            r *= 100;
        }
        float oov_r = Float.NaN;
        if (OOV > 0)
        {
            oov_r = OOV_R / (float) OOV;
            if (percentage)
                oov_r *= 100;
        }
        float iv_r = Float.NaN;
        if (IV > 0)
        {
            iv_r = IV_R / (float) IV;
            if (percentage)
                iv_r *= 100;
        }
        return new Result(p, r, 2 * p * r / (p + r), oov_r, iv_r);
    }
792615
public static final Function<Number,String> toPercentStr(Locale locale) {
        return new ToString(NumberFormatType.PERCENT, locale);
    }