
    1Vh                     ,    d Z ddlZddlZddlZd Zd Zy)zETensorBoard is a webapp for understanding TensorFlow runs and graphs.    Nc                       f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                      t          fd       d_        d_         G fddt        j                        } |      S )Nc                     j                   rt        dz        d_         	         }d_         | j                  j                  |j                         d_        |S # d_         w xY w)Nz,Circular import when resolving LazyModule %rTF)loadingImportError__dict__updateloaded)selfmoduleload_fn	load_oncenames     @/home/dcms/DCMS/lib/python3.12/site-packages/tensorboard/lazy.pyr   z-lazy_load.<locals>.wrapper.<locals>.load_once*   sn      !BTI  !%I* $)	!MM  1#IM %*	!s   A   	A)Fc                   ,    e Zd Z fdZ fdZ fdZy).lazy_load.<locals>.wrapper.<locals>.LazyModulec                 (    t         |       |      S N)getattr)r   	attr_namer   s     r   __getattr__z:lazy_load.<locals>.wrapper.<locals>.LazyModule.__getattr__@   s    y	::    c                 &    t         |             S r   )dirr   r   s    r   __dir__z6lazy_load.<locals>.wrapper.<locals>.LazyModule.__dir__C   s    9T?++r   c                 P    j                   rd |       z  S d| j                  z  S )Nz<%r via LazyModule (loaded)>z+<module %r via LazyModule (not yet loaded)>)r
   __name__r   s    r   __repr__z7lazy_load.<locals>.wrapper.<locals>.LazyModule.__repr__F   s/    ##9IdOKKAmm$r   N)r   
__module____qualname__r   r   r   )r   s   r   
LazyModuler   ?   s    ;,r   r"   )_memoizer   r
   types
ModuleType)r   r"   r   r   s   ` @r   wrapperzlazy_load.<locals>.wrapper'   sH     
	 
	 "	 	
	)) 	 $r    )r   r&   s   ` r   	lazy_loadr(      s     ' R Nr   c                      t               i t        j                         t        j                          fd       }|S )zKMemoizing decorator for f, which must have exactly 1 hashable
    argument.c                     j                  |       u r/5  j                  |       u r |       | <   d d d        |    S |    S # 1 sw Y   |    S xY wr   )get)argcacheflocknothings    r   r&   z_memoize.<locals>.wrapper\   sj    99S'"g- (99S'*g5!"3E#J( SzuSz( Szs    A

A)object	threadingRLock	functoolswraps)r.   r&   r-   r/   r0   s   ` @@@r   r#   r#   S   sA     hGE ??D__Q  Nr   )__doc__r4   r2   r$   r(   r#   r'   r   r   <module>r7      s!    L   9xr   