
    ]iM                         S r SSKrSSKrSSKrSSKrS0 4S\R                  \R                  \      S\	4S jjr
 " S S5      r " S S	5      rg)
z*
Non signal processing related utilities.
    Nattrs	overridesc                     [         R                  " U R                  5      R                  n/ nUc  [	        UR                  5       5      nU H  nSnXR;   a  X%   nO[        X5      (       a  [        X5      nOM-  XS;   a3  X5   nUR                  [         R                  L d  XxR                  :w  a  SnOSnU(       d  Mp  UR                  U SU 35        M     U R                  R                   SSR                  U5       S3$ )zx
Return a simple representation string for `obj`.
If `attrs` is not None, it should be a list of attributes to include.
FT=(,))inspect	signature	__class__
parameterslistkeyshasattrgetattrdefault_emptyappend__name__join)	objr   r   params
attrs_reprattrdisplayvalueparams	            I/mnt/rpi/tmp/demucs-venv-sys/lib/python3.13/site-packages/julius/utils.pysimple_reprr      s     s}}-88FJ}V[[]#OESC&E>LE}}.%==2HG7aw/0! " mm$$%Qsxx
';&<A>>    c                   J    \ rS rSrSr\R                  4S jrS rS r	S r
Srg)	MarkdownTable+   a	  
Simple MarkdownTable generator. The column titles should be large enough
for the lines content. This will right align everything.

>>> import io  # we use io purely for test purposes, default is sys.stdout.
>>> file = io.StringIO()
>>> table = MarkdownTable(["Item Name", "Price"], file=file)
>>> table.header(); table.line(["Honey", "5"]); table.line(["Car", "5,000"])
>>> print(file.getvalue().strip())  # Strip for test purposes
| Item Name | Price |
|-----------|-------|
|     Honey |     5 |
|       Car | 5,000 |
c                     Xl         X l        g Ncolumnsfile)selfr'   r(   s      r   __init__MarkdownTable.__init__:   s    	r    c                 d    U R                   R                  SSR                  U5      -   S-   5        g )N|z|
)r(   writer   )r)   lines     r   _writelnMarkdownTable._writeln>   s$    		chhtn,u45r    c                     U R                  S U R                   5       5        U R                  S U R                   5       5        g )Nc              3   .   #    U  H  nS U S 3v   M     g7f) N .0cols     r   	<genexpr>'MarkdownTable.header.<locals>.<genexpr>B   s     9LS#ajLs   c              3   D   #    U  H  nS [        U5      S-   -  v   M     g7f)-   N)lenr6   s     r   r9   r:   C   s     ClscSX\*ls    )r0   r'   r)   s    r   headerMarkdownTable.headerA   s.    9DLL99CdllCCr    c           
          / n[        XR                  5       H=  u  p4[        US[        [	        U5      5      -   5      nUR                  SU-   S-   5        M?     U R                  U5        g )N>r4   )zipr'   formatstrr>   r   r0   )r)   r/   outvalr8   s        r   r/   MarkdownTable.lineE   sW    D,,/HCcCCM12CJJsSy3' 0 	cr    r&   N)r   
__module____qualname____firstlineno____doc__sysstdoutr*   r0   r@   r/   __static_attributes__r5   r    r   r"   r"   +   s%     &)ZZ 6Dr    r"   c                   *    \ rS rSrSrS rS rS rSrg)ChronoM   a  
Measures ellapsed time, calling `torch.cuda.synchronize` if necessary.
`Chrono` instances can be used as context managers (e.g. with `with`).
Upon exit of the block, you can access the duration of the block in seconds
with the `duration` attribute.

>>> with Chrono() as chrono:
...     _ = sum(range(10_000))
...
>>> print(chrono.duration < 10)  # Should be true unless on a really slow computer.
True
c                     S U l         g r%   )durationr?   s    r   r*   Chrono.__init__Z   s	    r    c                 :    [         R                   " 5       U l        U $ r%   )time_beginr?   s    r   	__enter__Chrono.__enter__]   s    iikr    c                     SS K nUR                  R                  5       (       a  UR                  R                  5         [        R                  " 5       U R
                  -
  U l        g )Nr   )torchcudais_availablesynchronizerX   rY   rU   )r)   exc_type	exc_valueexc_tracebckr]   s        r   __exit__Chrono.__exit__a   s>    ::""$$JJ""$		dkk1r    )rY   rU   N)	r   rJ   rK   rL   rM   r*   rZ   rd   rP   r5   r    r   rR   rR   M   s    2r    rR   )rM   r
   typingtprN   rX   OptionalSequencerF   dictr   r"   rR   r5   r    r   <module>rk      s\      
  =A"$?BKKC(89 ??< D2 2r    