
    \!h
                     *    S SK r S SKr " S S\5      rg)    Nc                   (    \ rS rSrSrSS jrS rSrg)Counter   aY  Class to display the progress of for-loop iterators.

Parameters
----------
stderr : bool (default: True)
    Prints output to sys.stderr if True; uses sys.stdout otherwise.
start_newline : bool (default: True)
    Prepends a new line to the counter, which prevents overwriting counters
    if multiple counters are printed in succession.
precision: int (default: 0)
    Sets the number of decimal places when displaying the time elapsed in
    seconds.
name : string (default: None)
    Prepends the specified name before the counter to allow distinguishing
    between multiple counters.

Attributes
----------
curr_iter : int
    The current iteration.
start_time : float
    The system's time in seconds when the Counter was initialized.
end_time : float
    The system's time in seconds when the Counter was last updated.

Examples
--------
>>> cnt = Counter()
>>> for i in range(20):
...     # do some computation
...     time.sleep(0.1)
...     cnt.update()
20 iter | 2 sec
>>> print('The counter was initialized.'
          ' %d seconds ago.' % (time.time() - cnt.start_time))
The counter was initialized 2 seconds ago
>>> print('The counter was last updated'
          ' %d seconds ago.' % (time.time() - cnt.end_time))
The counter was last updated 0 seconds ago.

For more usage examples, please see
https://rasbt.github.io/mlxtend/user_guide/utils/Counter/

Nc                    U(       a  [         R                  U l        O[         R                  U l        [	        U[
        5      (       a  SU-  U l        OSU l        X@l        U R                  c  SU l        OSU R                  -  U l        [        R                  " 5       U l
        SU l        U(       a  U R                  R                  S5        g g )Nz%%.%dfz%d z%s: r   
)sysstderrstreamstdout
isinstanceint	precisionname_print_nametime
start_time	curr_iterwrite)selfr
   start_newliner   r   s        hC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\mlxtend/utils/counter.py__init__Counter.__init__;   s    **DK**DKi%%%	1DN!DN	99!D%		1D))+KKd#     c                 X   U =R                   S-  sl         [        R                  " 5       U l        SU R                   U R                  U R                  U R                  -
  -  4-  nU R
                  R                  SU R                  < U< 35        U R
                  R                  5         g)z)Print current iteration and time elapsed.   z%d iter | %s secN)	r   r   end_timer   r   r   r   r   flush)r   outs     r   updateCounter.updateP   s{    !		 NNNNdmmdoo=>$
 

 	d&6&6<=r   )r   r   r   r   r   r   r   )FTr   N)__name__
__module____qualname____firstlineno____doc__r   r"   __static_attributes__ r   r   r   r      s    +Z$*r   r   )r	   r   objectr   r*   r   r   <module>r,      s     Of Or   