code: def update_progress(self, progress, prefix=''):
          
          total_length = 40
  
          if progress == 1.:
              sys.stderr.write('\r' + ' ' * (total_length + len(prefix) + 50))
              sys.stderr.write('\n')
              sys.stderr.flush()
          else:
              bar_length = int(round(total_length * progress))
              sys.stderr.write('\r%s [%s%s] %.1f %% '
                               % (prefix, '=' * bar_length,
                                  ' ' * (total_length - bar_length),
                                  progress * 100))
              sys.stderr.flush()
docs: Print a progress bar for longer-running scripts.
  
          The progress value is a value between 0.0 and 1.0. If a prefix is
          present, it will be printed before the progress bar.