def progress_bar(finished, total, start_time=None, extra_info=None,<EOL>autocomplete=True, completion_string='<STR_LIT>'):
pct = int(<NUM_LIT> * finished / total)<EOL>ticks = int(pct / <NUM_LIT:2>)<EOL>spaces = int(<NUM_LIT:50> - ticks)<EOL>if start_time is not None:<EOL><INDENT>elapsed = (datetime.now() - start_time).seconds<EOL>minutes = int(elapsed / <NUM_LIT>)<EOL>seconds = int(elapsed % <NUM_LIT>)<EOL>minute_str = '<STR_LIT:0>' * (<NUM_LIT:2> - len(str(minutes))) + str(minutes)<EOL>second_str = '<STR_LIT:0>' * (<NUM_LIT:2> - len(str(seconds))) + str(seconds)<EOL>prog_bar = '<STR_LIT>'.format(finished, total,<EOL>'<STR_LIT:|>' * ticks, '<STR_LIT:U+0020>' * spaces, pct, minute_str, second_str)<EOL><DEDENT>else:<EOL><INDENT>prog_bar = '<STR_LIT>'.format(finished, total,<EOL>'<STR_LIT:|>' * ticks, '<STR_LIT:U+0020>' * spaces, pct)<EOL><DEDENT>if extra_info is not None:<EOL><INDENT>prog_bar += str(extra_info)<EOL><DEDENT>if autocomplete and finished == total:<EOL><INDENT>prog_bar += completion_string<EOL><DEDENT>sys.stdout.write(prog_bar)<EOL>sys.stdout.flush()<EOL>
Prints an ASCII progress bar.

Each call to ``progress_bar`` will update the progress bar. An example
of tracking the progress of a list of items would look like::

    job_list = [job1, job2, job3, ... jobN]
    total_jobs = len(job_list)

    #initialize the progress bar
    progress_bar(0, total_jobs)

    # do the jobs
    for i, job in enumerate(job_list):
        do_job(job)
        progress_bar(i + 1, total_jobs)

Args:

    finished (int): Number of finished jobs.

    total (int): Total number of jobs.

    start_time (datetime): Start time, as a ``datetime.datetime`` object.
        Only required if you want to display execution time alongside
        the progress bar. If not provided, execution time is not shown.

    extra_info (str): A string containing extra information to be displayed
        at the end of the progbar string. Examples include the number of failed
        jobs, the name of the job batch currently being processed, etc.

    complete (bool): If `True`, will append `completion_string` to the end
        of the progbar string.

    completion_string (str): Will be appended to the progbar string if
        `complete` is `True`. Default is `'\n\n'`.