o
    �ôjã  ã                   @   s0   d Z ddlZddlZddlZdd„ Zdd„ ZdS )zETensorBoard is a webapp for understanding TensorFlow runs and graphs.é    Nc                    s   ‡ fdd„}|S )a!  Decorator to define a function that lazily loads the module 'name'.

    This can be used to defer importing troublesome dependencies - e.g. ones that
    are large and infrequently used, or that cause a dependency cycle -
    until they are actually used.

    Args:
      name: the fully-qualified name of the module; typically the last segment
        of 'name' matches the name of the decorated function

    Returns:
      Decorator function that produces a lazy-loading module 'name' backed by the
      underlying decorated function.
    c                    s>   t ‡ ‡‡fdd„ƒ‰dˆ_dˆ_G ‡fdd„dtjƒ}|ˆƒS )Nc                    sJ   ˆj r	tdˆ ƒ‚dˆ_ zˆ ƒ }W dˆ_ ndˆ_ w | j |j¡ dˆ_|S )Nz,Circular import when resolving LazyModule %rTF)ÚloadingÚImportErrorÚ__dict__ÚupdateÚloaded)ÚselfÚmodule)Úload_fnÚ	load_onceÚname© úa/var/www/html/academy/tools/voices/clone/sv-venv/lib/python3.10/site-packages/tensorboard/lazy.pyr
   *   s   ÿz-lazy_load.<locals>.wrapper.<locals>.load_onceFc                       s0   e Zd Z‡ fdd„Z‡ fdd„Z‡ fdd„ZdS )z.lazy_load.<locals>.wrapper.<locals>.LazyModulec                    s   t ˆ | ƒ|ƒS ©N)Úgetattr)r   Ú	attr_name©r
   r   r   Ú__getattr__@   s   z:lazy_load.<locals>.wrapper.<locals>.LazyModule.__getattr__c                    s   t ˆ | ƒƒS r   )Údir©r   r   r   r   Ú__dir__C   s   z6lazy_load.<locals>.wrapper.<locals>.LazyModule.__dir__c                    s   ˆ j r	dˆ | ƒ S d| j S )Nz<%r via LazyModule (loaded)>z+<module %r via LazyModule (not yet loaded)>)r   Ú__name__r   r   r   r   Ú__repr__F   s   ÿÿz7lazy_load.<locals>.wrapper.<locals>.LazyModule.__repr__N)r   Ú
__module__Ú__qualname__r   r   r   r   r   r   r   Ú
LazyModule?   s    r   )Ú_memoizer   r   ÚtypesÚ
ModuleType)r	   r   ©r   )r	   r
   r   Úwrapper'   s   zlazy_load.<locals>.wrapperr   )r   r   r   r   r   Ú	lazy_load   s   )r    c                    s2   t ƒ ‰i ‰ t ¡ ‰t ˆ¡‡ ‡‡‡fdd„ƒ}|S )zKMemoizing decorator for f, which must have exactly 1 hashable
    argument.c                    sr   ˆ   | ˆ¡ˆu r5ˆ�# ˆ   | ˆ¡ˆu r#ˆ| ƒˆ | < W d   ƒ ˆ |  S W d   ƒ ˆ |  S 1 s0w   Y  ˆ |  S r   )Úget)Úarg©ÚcacheÚfÚlockÚnothingr   r   r   \   s   
þþ
ÿýz_memoize.<locals>.wrapper)ÚobjectÚ	threadingÚRLockÚ	functoolsÚwraps)r%   r   r   r#   r   r   S   s   r   )Ú__doc__r+   r)   r   r    r   r   r   r   r   Ú<module>   s   <