Returns a formatted ETA value for the progress bar.
481009
def str_eta(self):
        """"""
        if self.done:
            return eta_hms(self._eta.elapsed, always_show_hours=True, hours_leading_zero=True)
        if not self._eta_string:
            return ''
        return '{0} ETA'.format(self._eta_string)
683719
function (e, data) {
                if (data.context) {
                    var progress = Math.floor(data.loaded / data.total * 100);
                    data.context.find('.progress')
                        .attr('aria-valuenow', progress)
                        .find('.bar').css(
                            'width',
                            progress + '%'
                        );
                }
            }
755405
def update(self, pbar):
        """"""
        if pbar.currval == 0:
            return 'ETA:  --:--:--'
        elif pbar.finished:
            return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
        else:
            elapsed = pbar.seconds_elapsed
            currval1, elapsed1 = self._update_samples(pbar.currval, elapsed)
            eta = self._eta(pbar.maxval, pbar.currval, elapsed)
            if pbar.currval > currval1:
                etasamp = self._eta(pbar.maxval - currval1,
                                    pbar.currval - currval1,
                                    elapsed - elapsed1)
                weight = (pbar.currval / float(pbar.maxval)) ** 0.5
                eta = (1 - weight) * eta + weight * etasamp
            return 'ETA:  %s' % self.format_time(eta)
582658
def progress_bar(name, maxval, prefix='Converting'):
    
    widgets = ['{} {}: '.format(prefix, name), Percentage(), ' ',
               Bar(marker='=', left='[', right=']'), ' ', ETA()]
    bar = ProgressBar(widgets=widgets, max_value=maxval, fd=sys.stdout).start()
    try:
        yield bar
    finally:
        bar.update(maxval)
        bar.finish()
427979
def progress(count, total, suffix=''):
    '''
    
    '''
    bar_len = 60
    filled_len = int(round(bar_len * count / float(total)))
    percents = round(100.0 * count / float(total), 1)
    bar = '=' * filled_len + '-' * (bar_len - filled_len)
    sys.stdout.write('[%s] %s%s %s\r' % (bar, percents, '%', suffix))
    sys.stdout.flush()
491651
def percentage_progress(self):
        

        if self.total_progress != 0:
            return float(self.progress) / self.total_progress
        else:
            return self.progress
173597
function progressText()
    {
        if ( $this->Progress == self::PROGRESS_UNKNOWN )
        {
            return ezpI18n::tr( 'ezscriptmonitor', 'Unknown' );
        }

        if ( $this->Progress < 0 )
        {
            return '0%';
        }

        if ( $this->Progress > 100 )
        {
            return '100%';
        }

        return $this->Progress . '%';
    }
548104
def eta
      if @current == 0
        "ETA:  --:--:--"
      else
        elapsed_time = Time.now - @start_time
        estimated_time = elapsed_time * @total / @current - elapsed_time
        sprintf("ETA:  %s", format_time(estimated_time))
      end
    end
219960
def rate(self):
        """"""
        return float(self._eta.rate_unstable if self.eta_every > 1 else self._eta.rate)
804200
def bar(self, progress):
        """"""
        if not hasattr(self, "_limit") or not self._limit:
            self._limit = self.terminal_size()
        graph_progress = int(progress * self._limit)
        self.stdout.write('\r', ending='')
        progress_format = "[%-{}s] %d%%".format(self._limit)
        self.stdout.write(
            self.style.SUCCESS(progress_format % (self.progress_symbol * graph_progress, int(progress * 100))),
            ending=''
        )
        self.stdout.flush()
364780
String generateArrivalTime(RouteProgress routeProgress, Calendar time) {
    MapboxNavigationOptions options = mapboxNavigation.options();
    double legDurationRemaining = routeProgress.currentLegProgress().durationRemaining();
    int timeFormatType = options.timeFormatType();
    String arrivalTime = formatTime(time, legDurationRemaining, timeFormatType, isTwentyFourHourFormat);
    String formattedArrivalTime = String.format(etaFormat, arrivalTime);
    return formattedArrivalTime;
  }
1196960
def eta_letters(seconds):
    
    final_days, final_hours, final_minutes, final_seconds = 0, 0, 0, seconds
    if final_seconds >= 86400:
        final_days = int(final_seconds / 86400.0)
        final_seconds -= final_days * 86400
    if final_seconds >= 3600:
        final_hours = int(final_seconds / 3600.0)
        final_seconds -= final_hours * 3600
    if final_seconds >= 60:
        final_minutes = int(final_seconds / 60.0)
        final_seconds -= final_minutes * 60
    final_seconds = int(math.ceil(final_seconds))

    if final_days:
        template = '{1:d}d {2:d}h {3:02d}m {4:02d}s'
    elif final_hours:
        template = '{2:d}h {3:02d}m {4:02d}s'
    elif final_minutes:
        template = '{3:02d}m {4:02d}s'
    else:
        template = '{4:02d}s'

    return template.format(final_days, final_hours, final_minutes, final_seconds)
98255
public static function calculateDelay($eta)
    {
        if (null === $eta) {
            return 0;
        }

        $delay = -time() + self::normalizeEta($eta);

        return ($delay < 0) ? 0 : $delay;
    }
1130538
def format_progress(self, width):
        """"""
        chunk_widths = self._get_chunk_sizes(width)
        progress_chunks = [chunk.format_chunk(chunk_width)
                           for (chunk, chunk_width)
                           in zip(self._progress_chunks, chunk_widths)]
        return "{sep_start}{progress}{sep_end}".format(
            sep_start=self.sep_start,
            progress="".join(progress_chunks),
            sep_end=self.sep_end
        )
578515
def update(self, progress=0):
        
        self.progress += (progress or 1)
        if self.visible:
            if self.progress % self._mod == 1 or\
               self.progress == self.size - 1:
                print(self.format_bar(), end="\r")
            if self.progress == (self.size):
                self.finish()
830087
def _progress_bar(self, width, percent, left="", right="", fill="|"):
        
        text = left + (width - len(left) - len(right)) * " " + right
        cutoff = int(round(percent * width))
        text = text[:cutoff].replace(" ", fill) + text[cutoff:]
        low_cutoff = int(round(0.7 * width))
        med_cutoff = int(round(0.9 * width))
        if percent < 0.7:
            yield 2, text[:cutoff]
            yield 0, text[cutoff:]
        elif percent < 0.9:
            yield 2, text[:low_cutoff]
            yield 3, text[low_cutoff:cutoff]
            yield 0, text[cutoff:]
        else:
            yield 2, text[:low_cutoff]
            yield 3, text[low_cutoff:med_cutoff]
            yield 4, text[med_cutoff:cutoff]
            yield 0, text[cutoff:]
1368891
def _setup_bar(self):
        
        bar = u""
        items_cnt = len(PROGRESS_BAR_ITEMS)
        bar_val = float(self._time_left) / self._section_time * self.num_progress_bars
        while bar_val > 0:
            selector = int(bar_val * items_cnt)
            selector = min(selector, items_cnt - 1)
            bar += PROGRESS_BAR_ITEMS[selector]
            bar_val -= 1

        bar = bar.ljust(self.num_progress_bars)
        return bar