a
    Sic                     @   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_ 0 | j|j d_|S )Nz,Circular import when resolving LazyModule %rTF)loadingImportError__dict__updateloaded)selfmodule)load_fn	load_oncename L/var/www/html/django/DPS/env/lib/python3.9/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                    sX     | u rP,   | u r2|  | < W d    n1 sF0    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
   <