Computes average progress per bar
964704
private float getMapAvarageProgress(int tasksPerBar, int index
      , TaskReport[] reports ) {
    float progress = 0f;
    int k=0;
    for(;k < tasksPerBar && index + k < reports.length; k++) { 
      progress += reports[index + k].getProgress();
    }
    progress /= k;
    return progress;
  }
138659
def progressed_bar(count, total=100, status=None, suffix=None, bar_len=10):
    """"""
    status = status or ''
    suffix = suffix or '%'
    assert isinstance(count, int)
    count_normalized = count if count <= total else total
    filled_len = int(round(bar_len * count_normalized / float(total)))
    percents = 100.0 * count / float(total)
    color = '#5cb85c'
    if percents < 30.0:
        color = '#d9534f'
    if percents < 70.0:
        color = '#f0ad4e'
    text_color = colors.fg(color)
    bar_color = text_color + colors.bg(color)
    nc_color = colors.dark_gray
    progressbar = (colors.bg('#428bca') | status) if status else ''
    progressbar += (bar_color | ('█' * filled_len))
    progressbar += (nc_color | ('█' * (bar_len - filled_len)))
    progressbar += (text_color | (str(count) + suffix))
    return progressbar
678100
def apply(self, func, *args, **kwds):
        
        # estimate time to pandas apply
        wrapped = self._wrapped_apply(func, *args, **kwds)
        n_repeats = 3
        timed = timeit.timeit(wrapped, number=n_repeats)
        samp_proc_est = timed / n_repeats
        est_apply_duration = samp_proc_est / self._SAMP_SIZE * self._nrows

        # if pandas apply takes too long, use dask
        if est_apply_duration > self._dask_threshold:
            return self._dask_apply(func, *args, **kwds)
        else:  # use pandas
            if self._progress_bar:
                tqdm.pandas(desc="Pandas Apply")
                return self._obj_pd.progress_apply(func, *args, **kwds)
            else:
                return self._obj_pd.apply(func, *args, **kwds)
522368
def save_imglist(self, fname=None, root=None, shuffle=False):
        
        def progress_bar(count, total, suffix=''):
            import sys
            bar_len = 24
            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()

        str_list = []
        for index in range(self.num_images):
            progress_bar(index, self.num_images)
            label = self.label_from_index(index)
            if label.size < 1:
                continue
            path = self.image_path_from_index(index)
            if root:
                path = osp.relpath(path, root)
            str_list.append('\t'.join([str(index), str(2), str(label.shape[1])] \
              + ["{0:.4f}".format(x) for x in label.ravel()] + [path,]) + '\n')
        if str_list:
            if shuffle:
                import random
                random.shuffle(str_list)
            if not fname:
                fname = self.name + '.lst'
            with open(fname, 'w') as f:
                for line in str_list:
                    f.write(line)
        else:
            raise RuntimeError("No image in imdb")
657574
def init_progress_bar(self):
        """"""
        # Forked worker processes can't show progress bars.
        disable = MapReduce._forked or not config.PROGRESS_BARS

        # Don't materialize iterable unless we have to: huge iterables
        # (e.g. of `KCuts`) eat memory.
        if disable:
            total = None
        else:
            self.iterable = list(self.iterable)
            total = len(self.iterable)

        return tqdm(total=total, disable=disable, leave=False,
                    desc=self.description)
579474
def _draw_progressbar(self, columns=None, len_prefix=0, right_margin=0):
    
    if self._order == None:
      total = len(self._results)
    else:
      total = max(len(self._order), len(self._results))

    percent = int(round(len(self._results)/total*100)) if total else 0

    needs_break = lambda count: columns and count > columns \
                                and (count % (columns - right_margin))

    # together with unicode_literals `str('status')` seems the best
    # py2 and py3 compatible solution
    status = type(str('status'), (object,), dict(count=0,progressbar=[]))
    def _append(status, item, length=1, separator=''):
      # * assuming a standard item will take one column in the tty
      # * length must not be bigger than columns (=very narrow columns)
      progressbar = status.progressbar
      if needs_break(status.count + length + len(separator)):
        progressbar.append('\n')
        status.count = 0
      else:
        progressbar.append(separator)
      status.count += length + len(separator)
      progressbar.append(item)
    append=partial(_append, status)
    progressbar = status.progressbar

    append('', len_prefix)
    append('[')
    for item in self._progressbar:
      append(item)
    append(']')
    percentstring = f'{percent:3d}%'
    append(percentstring, len(percentstring), ' ')
    return ''.join(progressbar)
250033
function InstalationProgress(library, step, finished) {
  var fillSpaces = ' '.repeat(15 - library.length)
  if (finished) {
    return chalk.cyan.dim(' > ') + chalk.yellow.dim(library) + fillSpaces + chalk.green('Installed')
  } else {
    return chalk.cyan(' > ') + chalk.yellow(library) + fillSpaces+ chalk.blue(step)
  }
}
644685
def moving_average(iterable, n):
    
    it = iter(iterable)
    d = collections.deque(itertools.islice(it, n - 1))
    d.appendleft(0)
    s = sum(d)
    for elem in it:
        s += elem - d.popleft()
        d.append(elem)
        yield s / float(n)
249437
def colum_avg(self, state):
        """"""
        self.colum_avg_enabled = state > 0
        if self.colum_avg_enabled:
            self.return_max = lambda col_vals, index: col_vals[index]
        else:
            self.return_max = global_max
        self.reset()
13138
def _update_progress_bar(self):
        # type: (SyncCopy) -> None
        
        blobxfer.operations.progress.update_progress_bar(
            self._general_options,
            'synccopy',
            self._synccopy_start_time,
            self._synccopy_total,
            self._synccopy_sofar,
            self._synccopy_bytes_total,
            self._synccopy_bytes_sofar,
        )
254073
def moving_average_convergence(data, nslow=26, nfast=12):
    
    emaslow = moving_average(data, nslow, type='exponential')
    emafast = moving_average(data, nfast, type='exponential')
    return emaslow, emafast, emafast - emaslow
411070
def progress(self):
        
        return Progress(
            done=len(self._get_all_set_properties()),
            base=len(worker_mapping()),
        )
1244541
private float[] getReduceAvarageProgresses(int tasksPerBar, int index
      , TaskReport[] reports ) {
    float[] progresses = new float[] {0,0,0};
    int k=0;
    for(;k < tasksPerBar && index + k < reports.length; k++) {
      float progress = reports[index+k].getProgress();
      for(int j=0; progress > 0 ; j++, progress -= oneThird) {
        if(progress > oneThird)
          progresses[j] += 1f;
        else 
          progresses[j] += progress * 3 ;
      }
    }
    for(int j=0; j<3; j++) { progresses[j] /= k;}
    
    return progresses;
  }
542294
private static int printProgress(String str, long received,
      long advertisedSize, int lastPrinted) {
    if (advertisedSize == 0)
      return 0;
    int currentPercent = (int) ((received * 100) / advertisedSize);
    if (currentPercent != lastPrinted)
      FLOG.info("Downloading: " + str + ", completed: " + currentPercent);
    return currentPercent;
  }
900516
def print_progress_bar(text, done, total, width):
    
    if total > 0:
        n = int(float(width) * float(done) / float(total))
        sys.stdout.write("\r{0} [{1}{2}] ({3}/{4})".format(text, '#' * n, ' ' * (width - n), done, total))
        sys.stdout.flush()
1372395
def loadCurve(data, groups, thresholds, absvals, fs, xlabels):
        """"""
        xlims = (xlabels[0], xlabels[-1])
        pw = ProgressWidget(groups, xlims)
        spike_counts = []
        # skip control
        for itrace in range(data.shape[0]):
            count = 0
            for ichan in range(data.shape[2]):
                flat_reps = data[itrace,:,ichan,:].flatten()
                count += len(spikestats.spike_times(flat_reps, thresholds[ichan], fs, absvals[ichan]))
            spike_counts.append(count/(data.shape[1]*data.shape[2])) #mean spikes per rep

        i = 0
        for g in groups:
            for x in xlabels:
                pw.setPoint(x, g, spike_counts[i])
                i +=1

        return pw
1145255
def avg(self):
        """"""
        # XXX rename this method
        if len(self.values) > 0:
            return sum(self.values) / float(len(self.values))
        else:
            return None