
    KiJ	                         d dl Z d dlZd dlmZmZmZ d dlmZ ddlm	Z	  G d de j                        Z G d d	e      Zy)
    N)AnyIterableMapping)Self   )
CACHE_SIZEc                       e Zd ZU i Zeeee   ej                  f   e
eef   f   ed<   edej                  de
eef   fd       Zy)
Annotation_cache	signaturereturnc                 x   | |f}|| j                   v r:t        j                  t        | j                         ddi       | j                   |   S i }|j                  j                         D ]  \  }}|j                  t        j                  j                  k(  r.	 |j                  j                  }|D ]<  }t        ||       r|||<   t        |t              s&t        ||       s3 |       ||<   >  || j                   |<   t        j                  t        | j                         ddi       |S # t        $ r Y w xY w)Ncache
annotation)r   r   setlen
parametersitemsr   inspect	Parameterempty__metadata__AttributeError
isinstancetype
issubclass)clsr   key	annotated
param_nameparammetadataarg_types           ^/home/jay/workspace/scripts/.codegraph-venv/lib/python3.12/site-packages/docket/annotations.pyannotated_parameterszAnnotation.annotated_parameters   s$   I#**NN3szz?Wl,CD::c?"%'	!*!5!5!;!;!= 	7J7#4#4#:#::*/*:*:*G*G % 7h,,4Ij)$/Jx4M,4JIj)	7	7 $

3s3::,(?@ " s   D--	D98D9N)__name__
__module____qualname__r   dicttupler   r   r   	Signaturer   str__annotations__classmethodr%        r$   r
   r
   
   sc    MOFDtDz7#4#445wsDy7IIJOW->-> 73PT9CU  r0   r
   c                   B    e Zd ZU dZdZeed<   d	deddfdZdede	fdZ
y)
Loggeda(  Instructs docket to include arguments to this parameter in the log.

    If `length_only` is `True`, only the length of the argument will be included in
    the log.

    Example:

    ```python
    @task
    def setup_new_customer(
        customer_id: Annotated[int, Logged],
        addresses: Annotated[list[Address], Logged(length_only=True)],
        password: str,
    ) -> None:
        ...
    ```

    In the logs, you's see the task referenced as:

    ```
    setup_new_customer(customer_id=123, addresses[len 2], password=...)
    ```
    Flength_onlyr   Nc                     || _         y )N)r3   )selfr3   s     r$   __init__zLogged.__init__E   s
    &r0   argumentc                     | j                   r_t        |t        t        f      rdt	        |       dS t        |t
              rdt	        |       dS t        |d      rdt	        |       dS t        |      S )Nz{len }z(len )__len__z[len ])r3   r   r)   r   r   r*   hasattrrepr)r5   r7   s     r$   formatzLogged.formatH   sp    (T3K0Hb11He,s8}oQ//9-s8}oQ//H~r0   )F)r&   r'   r(   __doc__r3   boolr-   r6   r   r,   r?   r/   r0   r$   r2   r2   *   s9    0 K'D 'T '	s 	s 	r0   r2   )abcr   typingr   r   r   typing_extensionsr   instrumentationr   ABCr
   r2   r/   r0   r$   <module>rG      s4    
  ) ) " ' @'Z 'r0   