Construct a tqdm progress bar object, if tqdm is installed.
514556
def _get_progress_bar(self, progress_bar_type):
        """"""
        if tqdm is None:
            if progress_bar_type is not None:
                warnings.warn(_NO_TQDM_ERROR, UserWarning, stacklevel=3)
            return None

        description = "Downloading"
        unit = "rows"

        try:
            if progress_bar_type == "tqdm":
                return tqdm.tqdm(desc=description, total=self.total_rows, unit=unit)
            elif progress_bar_type == "tqdm_notebook":
                return tqdm.tqdm_notebook(
                    desc=description, total=self.total_rows, unit=unit
                )
            elif progress_bar_type == "tqdm_gui":
                return tqdm.tqdm_gui(desc=description, total=self.total_rows, unit=unit)
        except (KeyError, TypeError):
            # Protect ourselves from any tqdm errors. In case of
            # unexpected tqdm behavior, just fall back to showing
            # no progress bar.
            warnings.warn(_NO_TQDM_ERROR, UserWarning, stacklevel=3)
        return None
1156322
def _update_progress_bar(self):
        # type: (Downloader) -> None
        
        blobxfer.operations.progress.update_progress_bar(
            self._general_options,
            'download',
            self._download_start_time,
            self._download_total,
            self._download_sofar,
            self._download_bytes_total,
            self._download_bytes_sofar,
        )
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()
766450
def progress_patch(self, _=False):
        
        from .progress import ShellProgressView
        self.cli_ctx.progress_controller.init_progress(ShellProgressView())
        return self.cli_ctx.progress_controller
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()
1297478
def progress_bar(items_total, items_progress, columns=40, base_char='.', progress_char='#', percentage=False, prefix='', postfix=''):
    
    bins_total = int(float(items_total) / columns) + 1
    bins_progress = int((float(items_progress) / float(items_total)) * bins_total) + 1
    progress = prefix
    progress += progress_char * bins_progress
    progress += base_char * (bins_total - bins_progress)
    if percentage:
        progress_percentage = float(items_progress) / float(items_total) * 100
        # Round the percentage to two decimals
        postfix = ' ' + str(round(progress_percentage, 2)) + '% ' + postfix
    progress += postfix
    return progress
836911
def add_progress(kwargs, git, progress):
    """"""
    if progress is not None:
        v = git.version_info[:2]
        if v >= (1, 7):
            kwargs['progress'] = True
        # END handle --progress
    # END handle progress
    return kwargs
263154
def select_tqdm():
    
    try:
        progress = tqdm.tqdm_notebook
        assert get_ipython().has_trait('kernel')
    except (NameError, AssertionError):
        progress = tqdm.tqdm
    return progress
491651
def percentage_progress(self):
        

        if self.total_progress != 0:
            return float(self.progress) / self.total_progress
        else:
            return self.progress
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)
  }
}
25736
def progress(self):
        

        if not self._progress:

            # If won't be building, only use one connection
            new_connection = False if self._library.read_only else True

            self._progress = ProcessLogger(self.dataset, self.logger, new_connection=new_connection)

        return self._progress
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()
7551
def xgb_progressbar(rounds=1000):
    
    pbar = tqdm(total=rounds)

    def callback(_, ):
        pbar.update(1)

    return callback
1360745
def _ProgressMeterUpdate(bar, value, text_elem, *args):
    '''
    
    '''
    global _my_windows
    if bar == None: return False
    if bar.BarExpired: return False
    message, w, h = ConvertArgsToSingleString(*args)
    text_elem.Update(message)
    # bar.TextToDisplay = message
    bar.CurrentValue = value
    rc = bar.UpdateBar(value)
    if value >= bar.MaxValue or not rc:
        bar.BarExpired = True
        bar.ParentForm._Close()
        if rc:  # if update was OK but bar expired, decrement num windows
            _my_windows.Decrement()
    if bar.ParentForm.RootNeedsDestroying:
        try:
            bar.ParentForm.TKroot.destroy()
            # there is a bug with progress meters not decrementing the number of windows
            # correctly when the X is used to close the window
            # uncommenting this line fixes that problem, but causes a double-decrement when
            # the cancel button is used... damned if you do, damned if you don't, so I'm choosing
            # don't, as in don't decrement too many times. It's OK now to have a mismatch in
            # number of windows because of the "hidden" master window. This ensures all windows
            # will be toplevel.  Sorry about the bug, but the user never sees any problems as a result
            # _my_windows.Decrement()
        except:
            pass
        bar.ParentForm.RootNeedsDestroying = False
        bar.ParentForm.__del__()
        return False

    return rc
143767
def install_completion(ctx, attr, value):  # pragma: no cover
    """"""
    import click_completion.core

    if not value or ctx.resilient_parsing:
        return value

    shell, path = click_completion.core.install()
    click.secho(
        '{0} completion installed in {1}'.format(shell, path), fg='green'
    )
    ctx.exit()
974913
def _do_watch_progress(filename, sock, handler):
    """"""
    connection, client_address = sock.accept()
    data = b''
    try:
        while True:
            more_data = connection.recv(16)
            if not more_data:
                break
            data += more_data
            lines = data.split(b'\n')
            for line in lines[:-1]:
                line = line.decode()
                parts = line.split('=')
                key = parts[0] if len(parts) > 0 else None
                value = parts[1] if len(parts) > 1 else None
                handler(key, value)
            data = lines[-1]
    finally:
        connection.close()
1369140
def _initialize_progressbar(self):
        

        self._progressbar = progressbar.ProgressBar(widgets=Analysis._PROGRESS_WIDGETS, maxval=10000 * 100).start()