
    ,h=                     z    d dl Z ddlmZmZ ddlmZmZmZ ddlm	Z	 dde
ddfdZd	 Zddedfd
Zd Zd Z	 ddZy)    N   )PY_3_9_PLUSget_generic_base)_OBJ_SETATTRNOTHINGfields)AttrsAttributeNotFoundErrorTFc                 0   t        | j                        } |       }|D ]7  }t        | |j                        }	
 ||	      s&
 | ||	      }	|du rt	        |	j                        rt        |	d|      ||j                  <   jt        |	t        t        t        t        f      rKdu r|	j                  nt        }
|	D cg c]  }t        |d|       }}	  |
|      ||j                  <   t        |	t              r3| fd|	j                         D              ||j                  <   |	||j                  <   )|	||j                  <   : |S c c}w # t        $ r' t        |
t              s  |
| ||j                  <   Y qw xY w)a  
    Return the *attrs* attribute values of *inst* as a dict.

    Optionally recurse into other *attrs*-decorated classes.

    Args:
        inst: Instance of an *attrs*-decorated class.

        recurse (bool): Recurse into classes that are also *attrs*-decorated.

        filter (~typing.Callable):
            A callable whose return code determines whether an attribute or
            element is included (`True`) or dropped (`False`).  Is called with
            the `attrs.Attribute` as the first argument and the value as the
            second argument.

        dict_factory (~typing.Callable):
            A callable to produce dictionaries from.  For example, to produce
            ordered dictionaries instead of normal Python dictionaries, pass in
            ``collections.OrderedDict``.

        retain_collection_types (bool):
            Do not convert to `list` when encountering an attribute whose type
            is `tuple` or `set`.  Only meaningful if *recurse* is `True`.

        value_serializer (typing.Callable | None):
            A hook that is called for every attribute or dict key/value.  It
            receives the current instance, field and value and must return the
            (updated) value.  The hook is run *after* the optional *filter* has
            been applied.

    Returns:
        Return type of *dict_factory*.

    Raises:
        attrs.exceptions.NotAnAttrsClassError:
            If *cls* is not an *attrs* class.

    ..  versionadded:: 16.0.0 *dict_factory*
    ..  versionadded:: 16.1.0 *retain_collection_types*
    ..  versionadded:: 20.3.0 *value_serializer*
    ..  versionadded:: 21.3.0
        If a dict has a collection for a key, it is serialized as a tuple.
    Trecursefilterdict_factoryretain_collection_typesvalue_serializerFis_keyr   r   r   r   c           
   3   h   K   | ])  \  }}t        |d       t        |d      f + ywTr   FN_asdict_anything.0kkvvdfr   r   r   s      M/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/attr/_funcs.py	<genexpr>zasdict.<locals>.<genexpr>j   sW       & B# )#'#))+4K-= )#(#))+4K-=    /2)r   	__class__getattrnamehasasdict
isinstancetuplelistset	frozensetr   	TypeError
issubclassdictitems)instr   r   r   r   r   attrsrvavcfir,   r   s     ` ``       @r   r#   r#      s   h 4>>"E	B AD!&&!fQl' q!,Ad?1;;# !!-,C%5166
 AtS)<=$;t$CQ[[ 
  %$%%10G)9
 
,!#EBqvvJ At$!  & #$'')'  166
, 166
BqvvJCAD I]
 ! ,%b%0 "$UBqvvJ,s   E "E%%,FFc                   	 t        | j                  dd      t        | d|      }|S t        | t        t
        t        t        f      rGdu r| j                  }n|rt        }nt
        } || D cg c]  }t        |d|       c}      }|S t        | t              r&|	 		fd| j                         D              }|S | }
 dd|      }|S c c}w )zK
    ``asdict`` only works on attrs instances, this works on anything.
    __attrs_attrs__NTr   Fr   c           
   3   h   K   | ])  \  }}t        |d       t        |d      f + ywr   r   r   s      r   r   z#_asdict_anything.<locals>.<genexpr>   sW      
& B# !!!#,C%5 ! !!#,C%5
r   )r    r   r#   r$   r%   r&   r'   r(   r   r+   r,   )
valr   r   r   r   r   r/   r2   r3   r   s
     ` ``   @r   r   r      s    s}}/6B%$;-
r Ic 
C%sI6	7"d*BBB 
  ! !!-,C%5

R I9 
C	 
& ))+'
 
4 I	 '!$b1BIQ
s   5Cc                    t        | j                        }g }||D ]]  }t        | |j                        }|
 |||      s&|du r"t	        |j                        r |j                  t        |d|             `t        |t        t        t        t        f      rcdu r|j                  nt        }	|D 
cg c])  }
t	        |
j                        rt        |
d|      n|
+ }}
	 |j                   |	|             t        |t              rGdu r|j                  nt        }|j                   |fd|j                         D                     :|j                  |       M|j                  |       ` t        u r|S  |      S c c}
w # t        $ r) t        |	t              s |j                   |	|        Y w xY w)az  
    Return the *attrs* attribute values of *inst* as a tuple.

    Optionally recurse into other *attrs*-decorated classes.

    Args:
        inst: Instance of an *attrs*-decorated class.

        recurse (bool):
            Recurse into classes that are also *attrs*-decorated.

        filter (~typing.Callable):
            A callable whose return code determines whether an attribute or
            element is included (`True`) or dropped (`False`).  Is called with
            the `attrs.Attribute` as the first argument and the value as the
            second argument.

        tuple_factory (~typing.Callable):
            A callable to produce tuples from. For example, to produce lists
            instead of tuples.

        retain_collection_types (bool):
            Do not convert to `list` or `dict` when encountering an attribute
            which type is `tuple`, `dict` or `set`. Only meaningful if
            *recurse* is `True`.

    Returns:
        Return type of *tuple_factory*

    Raises:
        attrs.exceptions.NotAnAttrsClassError:
            If *cls* is not an *attrs* class.

    ..  versionadded:: 16.2.0
    T)r   r   tuple_factoryr   c              3      K   | ]Q  \  }}t        |j                        rt        |       n|t        |j                        rt        |       n|f S yw))r9   r   N)r"   r   astuple)r   r   r   retainr9   s      r   r   zastuple.<locals>.<genexpr>&  sk      * #B $'r||#4 !($&2?<B!" &( $'r||#4 !($&2?<B!" &(#s   AA)r   r   r    r!   r"   appendr;   r$   r%   r&   r'   r(   r)   r*   r+   r,   )r-   r   r   r9   r   r.   r/   r0   r1   r2   jr,   r   r<   s      `         @r   r;   r;      s   T 4>>"E	B$F ED!&&!fQld?1;;		 $%&306 AtS)<=$*dNQ[[   q{{+  $(#)*74:  *IIbi( At$$*dNQ[[		 * '(ggi+ 4 		!IIaLKEN $&2=M",==m  ! *%b%0 IIb%j)*s   8.F)F.GGc                 r    t        | dd      }|yt        |       }|t        |dd      }||| _        |duS y)z
    Check whether *cls* is a class with *attrs* attributes.

    Args:
        cls (type): Class to introspect.

    Raises:
        TypeError: If *cls* is not a class.

    Returns:
        bool:
    r5   NTF)r    r   r5   )clsr.   generic_basegeneric_attrss       r   r"   r"   F  sY     C*D1E $C(L.?F$"/CD((    c                    t        j                   |       }t        | j                        }|j                         D ]H  \  }}t	        ||t
              }|t
        u r| d|j                   d}t        |      t        |||       J |S )a  
    Copy *inst* and apply *changes*.

    This is different from `evolve` that applies the changes to the arguments
    that create the new instance.

    `evolve`'s behavior is preferable, but there are `edge cases`_ where it
    doesn't work. Therefore `assoc` is deprecated, but will not be removed.

    .. _`edge cases`: https://github.com/python-attrs/attrs/issues/251

    Args:
        inst: Instance of a class with *attrs* attributes.

        changes: Keyword changes in the new copy.

    Returns:
        A copy of inst with *changes* incorporated.

    Raises:
        attrs.exceptions.AttrsAttributeNotFoundError:
            If *attr_name* couldn't be found on *cls*.

        attrs.exceptions.NotAnAttrsClassError:
            If *cls* is not an *attrs* class.

    ..  deprecated:: 17.1.0
        Use `attrs.evolve` instead if you can. This function will not be
        removed du to the slightly different approach compared to
        `attrs.evolve`, though.
    z is not an attrs attribute on .)copyr   r   r,   r    r   r	   r   )r-   changesnewr.   kr1   r0   msgs           r   assocrK   b  s    @ ))D/C4>>"E  1E1g&<C5cmm_AFC-c22S!Q  JrC   c                     t        | dd      | k7  rkddl}||d}t        r||d<    |j                  | fi |}|t	        |       n|D ]+  }|j
                  |v st        |d||j
                            - | | _        | S )a  
    Resolve any strings and forward annotations in type annotations.

    This is only required if you need concrete types in :class:`Attribute`'s
    *type* field. In other words, you don't need to resolve your types if you
    only use them for static type checking.

    With no arguments, names will be looked up in the module in which the class
    was created. If this is not what you want, for example, if the name only
    exists inside a method, you may pass *globalns* or *localns* to specify
    other dictionaries in which to look up these names. See the docs of
    `typing.get_type_hints` for more details.

    Args:
        cls (type): Class to resolve.

        globalns (dict | None): Dictionary containing global variables.

        localns (dict | None): Dictionary containing local variables.

        attribs (list | None):
            List of attribs for the given class. This is necessary when calling
            from inside a ``field_transformer`` since *cls* is not an *attrs*
            class yet.

        include_extras (bool):
            Resolve more accurately, if possible. Pass ``include_extras`` to
            ``typing.get_hints``, if supported by the typing module. On
            supported Python versions (3.9+), this resolves the types more
            accurately.

    Raises:
        TypeError: If *cls* is not a class.

        attrs.exceptions.NotAnAttrsClassError:
            If *cls* is not an *attrs* class and you didn't pass any attribs.

        NameError: If types cannot be resolved because of missing variables.

    Returns:
        *cls* so you can use this function also as a class decorator. Please
        note that you have to apply it **after** `attrs.define`. That means the
        decorator has to come in the line **before** `attrs.define`.

    ..  versionadded:: 20.1.0
    ..  versionadded:: 21.1.0 *attribs*
    ..  versionadded:: 23.1.0 *include_extras*
    __attrs_types_resolved__Nr   )globalnslocalnsinclude_extrastype)r    typingr   get_type_hintsr   r!   r   rM   )	r@   rN   rO   attribsrP   rR   kwargshintsfields	            r   resolve_typesrX     s    j s.5<&7;'5F#$%%%c4V4$+OVC[ 	?EzzU"UFE%**,=>	? (+$ JrC   )NNNT)rF   _compatr   r   _maker   r   r   
exceptionsr	   r+   r#   r   r%   r;   r"   rK   rX    rC   r   <module>r]      sb     2 0 0 3
 !xvFV !t>n8(X DHGrC   