Wraps the provided sequence with an iterator that tracks its progress 
    on the console.

        >>> for i in prog_iter(xrange(100)): pass
        ..................................................
        ..................................................
         (0.000331163406372 s)
         
    More specifically, the behavior is as follows:
    
    - Produces a progress bar on stdout, at ``delta`` increments, where 
      ``delta`` is a percentage (represented as a float from 0.0 to 1.0)
    - Newline every line_size dots (defaults to 50)
    - Displays the time the loop took, as in toc() (without interfering with toc)
    - A prog_iter nested in another prog_iter will not produce any of these
      side effects. That is, only one progress bar will ever be printing at a time.

def prog_iter(bounded_iterable, delta=0.01, line_size=50):
    '''Wraps the provided sequence with an iterator that tracks its progress 
    on the console.

        >>> for i in prog_iter(xrange(100)): pass
        ..................................................
        ..................................................
         (0.000331163406372 s)
         
    More specifically, the behavior is as follows:
    
    - Produces a progress bar on stdout, at ``delta`` increments, where 
      ``delta`` is a percentage (represented as a float from 0.0 to 1.0)
    - Newline every line_size dots (defaults to 50)
    - Displays the time the loop took, as in toc() (without interfering with toc)
    - A prog_iter nested in another prog_iter will not produce any of these
      side effects. That is, only one progress bar will ever be printing at a time.
    
    '''
    # TODO: Technically, this should have a __len__.
    global _prog_iterin_loop

    if not _prog_iterin_loop:
        startTime = _time.time()
        _prog_iterin_loop = True
        length = float(len(bounded_iterable))
        _sys.stdout.write(".")
        dots = 1
        next = delta
        for i, item in enumerate(bounded_iterable):
            if (i + 1) / length >= next:
                next += delta
                dots += 1
                _sys.stdout.write(".")
                if dots % line_size == 0:
                    _sys.stdout.write("\n")
                _sys.stdout.flush()
            yield item
        print((" (" + str(_time.time() - startTime) + " s)"))
        _prog_iterin_loop = False
    else:
        for item in bounded_iterable:
            yield item