
    h                         S SK rS SKrS SKrS SKJrJr  S SKJr  S r	S\
S\4S jrS\
4S jr/ rSS	\
S
\\
   S\4S jjrSS	\
S
\\
   S\4S jjrSrSr\" \SSS9r\4S jr\S4S jr\" \\S9r\" \SSS9rS rS rg)    N)wrapspartial)Optionalc           	          U [         R                  ;  a  U$ [         R                  R                  U S5      n/ SQn/ SQnX#;   a  gX$;  a  [        SU  SU SX4-    35      eg)	z-Check if environment varable has True-y value0)1trueTRUEonONyesYES)r   falseFALSEoffOFFnoNOTz'Unexpected environment variable value `=z`. Expected one of F)osenvirongetRuntimeError)vardefaultvaltruesfalsess        Y/var/www/auris/envauris/lib/python3.13/site-packages/torchaudio/_internal/module_utils.pyeval_envr       sq    
"**
**..c
"C;E>F
|
5cU!C5 A$~.01 	1     modulesreturnc                  &    [        S U  5       5      $ )a<  Returns if a top-level module with :attr:`name` exists *without**
importing it. This is generally safer than try-catch block around a
`import X`. It avoids third party libraries breaking assumptions of some of
our tests, e.g., setting multiprocessing start method when imported
(see librosa/#747, torchvision/#544).
c              3   d   #    U  H&  n[         R                  R                  U5      S Lv   M(     g 7fN)	importlibutil	find_spec).0ms     r   	<genexpr>&is_module_available.<locals>.<genexpr>"   s$     H1y~~''*$6s   .0)all)r"   s    r   is_module_availabler/      s     HHHHr!   c                     ^ U  Vs/ s H  n[        U5      (       a  M  UPM     nnU(       d  S nU$ [        U5      S:X  a  SUS    3OSU 3mU4S jnU$ s  snf )zDecorate function to give error message if invoked without required optional modules.

This decorator is to give better error message to users rather
than raising ``NameError:  name 'module' is not defined`` at random places.
c                     U $ r&    funcs    r   	decorator"requires_module.<locals>.decorator/   s    Kr!      zmodule: r   z	modules: c                 4   >^  [        T 5      U U4S j5       nU$ )Nc                  R   > [        TR                   STR                   ST 35      e)N.z
 requires r   
__module____name__)argskwargsr4   reqs     r   wrapped3requires_module.<locals>.decorator.<locals>.wrapped6   s*    "doo%6ajQTPU#VWWr!   r   )r4   rA   r@   s   ` r   r5   r6   5   s"    4[X X Nr!   )r/   len)r"   r+   missingr5   r@   s       @r   requires_modulerF   %   sj     "@'Q)<Q)?q'G@	  *-W):%)G9@U	 # As
   AA	directionversionremovec                 @   ^ ^^^^ [        T 5      UU UUU4S j5       nU$ )Nc                     > T ST 3nT(       a  USTc  SOS[        T5      -    S3-  n[        R                  " USS9  T" U 0 UD6$ )Nz has been deprecated. z It will be removed from za futurezthe 
 release.    )
stacklevel)strwarningswarn)r>   r?   messagerG   r4   namerI   rH   s      r   rA    wrap_deprecated.<locals>.wrappedA   s^    F0<2:V\_bcj_kVk2llvwwGg!,T$V$$r!   rC   )r4   rS   rG   rH   rI   rA   s   ````` r   wrap_deprecatedrU   @   s%    
4[% % % Nr!   c                    ^ ^^ U UU4S jnU$ )zDecorator to add deprecation message

Args:
    direction (str): Migration steps to be given to users.
    version (str or int): The version when the object will be removed
    remove (bool): If enabled, append future removal message.
c                    > [        X R                   SU R                   3TTTS9nSnT(       a  USTc  SOT S3-  nSU ST S	U R                   S
3Ul        [        R                  U5        U$ )Nr:   rH   rI   z#This function has been deprecated. zIt will be removed from futurerL   z%DEPRECATED

    .. warning::

       z
       z

    
    )rU   r<   r=   __doc__UNSUPPORTEDappend)r4   rA   rR   rG   rI   rH   s      r   r5   deprecated.<locals>.decoratorS   s    !$??*;1T]]O(Liahqwx71go(SZ1[[effG 	y { 	\\N  	7#r!   r2   )rG   rH   rI   r5   s   ``` r   
deprecatedr_   J   s    ( r!   zThis deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.a*  This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. The decoding and encoding capabilities of PyTorch for both audio and video are being consolidated into TorchCodec. Please see https://github.com/pytorch/audio/issues/3902 for more information.2.9TrX   c                     [        U R                  U R                   SU R                   3USSS9U l        SU SU R                   S3U l        [
        R                  U 5        U $ )Nr:   r`   TrX   ztDEPRECATED

.. warning::

    This class is deprecated from version 2.8. It will be removed in the 2.9 release.
    
)rU   __init__r<   r=   r[   r\   r]   )cmsgs     r   dropping_class_supportrf   v   sl     ~Qqzzl-KSZ_hlmAJ
 	E 
 AI qHr!   c                 6    SU SU R                    S3U l         U $ )Nz[DEPRECATED]

.. warning::

    This object is deprecated deprecated from version 2.8. It will be removed in the 2.9 release.
    rb   rZ   )r[   )rd   re   rS   s      r   dropping_const_supportrh      s1    
 	E 
 AI Hr!   )re   c                    ^  U 4S jnU$ )zLGenerate decorator to give users message about missing TorchAudio extension.c                 4   >^  [        T 5      U U4S j5       nU$ )Nc                  R   > [        TR                   STR                   ST 35      e)Nr:    r;   )r>   r?   r4   rR   s     r   rA   5fail_with_message.<locals>.decorator.<locals>.wrapped   s(    $//!2!DMM?!G9MNNr!   rC   )r4   rA   rR   s   ` r   r5   $fail_with_message.<locals>.decorator   s"    	t	O 
	O r!   r2   )rR   r5   s   ` r   fail_with_messagero      s     r!   c                     U $ )zlOp-op decorator. Used in place of fail_with_message when a functionality that requires extension works fine.r2   r3   s    r   no_oprq      s    Kr!   )NF)importlib.utilr'   r   rP   	functoolsr   r   typingr   r    rO   boolr/   rF   r\   rU   r_   DEPRECATION_MSGIO_DEPRECATION_MSGdropping_supportrf   rh   dropping_class_io_supportdropping_io_supportro   rq   r2   r!   r   <module>r{      s     	  $ &I# I$ Ic 2 3 # W[ #  d @T T  ouTJ "1  #2 	 $$:@RS  !3U4P 
r!   