
    ,hW?                    2   d Z ddlmZ ddlZddlZddlZddlmZm	Z	m
Z
mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZmZmZmZ dd	lmZ dd
lmZ ddlmZ ddl m!Z! ddl"m#Z#m$Z$m%Z% erddl&m'Z' ddl(m)Z) dZ* ed      Z+ejX                  dk\  r eejZ                  e#e%f      eddddddddddd
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$d              Z. eejZ                  e#e%f      eddddddddddd
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d%d              Z.n| eejZ                  e#e%f      eddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d&d              Z. eejZ                  e#e%f      eddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d'd              Z. eejZ                  e#e%f      	 d(ddddddddddd
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d)d       Z. ee/      Z0ejX                  dk  rd*dZ1e1ejd                  _3        ddd dd!	 	 	 	 	 	 	 	 	 	 	 d+d"Z4d,d#Z5y)-z7Provide an enhanced dataclass that performs validation.    )annotationsN)TYPE_CHECKINGAnyCallableGenericLiteralNoReturnTypeVaroverload)warn)	TypeGuarddataclass_transform   )_config_decorators_namespace_utils_typing_extra)_dataclasses)getattr_migration)
ConfigDict)PydanticUserError)Field	FieldInfoPrivateAttr)PydanticDataclass)MappingNamespace)	dataclassrebuild_dataclass_T   
   )field_specifiersFT.
initrepreqorderunsafe_hashfrozenconfigvalidate_on_initkw_onlyslotsc        
             y N r$   s
             V/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pydantic/dataclasses.pyr   r      s     	    c       
             y r0   r1   )_clsr%   r&   r'   r(   r)   r*   r+   r,   r-   r.   s              r2   r   r   /   s     #&r3   r%   r&   r'   r(   r)   r*   r+   r,   c                     y r0   r1   r6   s           r2   r   r   B   s     	r3   c                    y r0   r1   )	r5   r%   r&   r'   r(   r)   r*   r+   r,   s	            r2   r   r   Q   s     #&r3   c       
   	         |du sJ d       |dusJ d       t         j                  dk\  r|	|
dni ddd	fd}| |S  ||       S )
a  !!! abstract "Usage Documentation"
        [`dataclasses`](../concepts/dataclasses.md)

    A decorator used to create a Pydantic-enhanced dataclass, similar to the standard Python `dataclass`,
    but with added validation.

    This function should be used similarly to `dataclasses.dataclass`.

    Args:
        _cls: The target `dataclass`.
        init: Included for signature compatibility with `dataclasses.dataclass`, and is passed through to
            `dataclasses.dataclass` when appropriate. If specified, must be set to `False`, as pydantic inserts its
            own  `__init__` function.
        repr: A boolean indicating whether to include the field in the `__repr__` output.
        eq: Determines if a `__eq__` method should be generated for the class.
        order: Determines if comparison magic methods should be generated, such as `__lt__`, but not `__eq__`.
        unsafe_hash: Determines if a `__hash__` method should be included in the class, as in `dataclasses.dataclass`.
        frozen: Determines if the generated class should be a 'frozen' `dataclass`, which does not allow its
            attributes to be modified after it has been initialized. If not set, the value from the provided `config` argument will be used (and will default to `False` otherwise).
        config: The Pydantic config to use for the `dataclass`.
        validate_on_init: A deprecated parameter included for backwards compatibility; in V2, all Pydantic dataclasses
            are validated on init.
        kw_only: Determines if `__init__` method parameters must be specified by keyword only. Defaults to `False`.
        slots: Determines if the generated class should be a 'slots' `dataclass`, which does not allow the addition of
            new attributes after instantiation.

    Returns:
        A decorator that accepts a class as its argument and returns a Pydantic `dataclass`.

    Raises:
        AssertionError: Raised if `init` is not `False` or `validate_on_init` is `False`.
    Fz7pydantic.dataclasses.dataclass only supports init=Falsez-validate_on_init=False is no longer supportedr    )r-   r.   c                   | j                   D ]  }t        |di       }|D ]  }t        | |d      }t        |t              s!d|i}t        j
                  dk\  r|j                  rd|d<   |j                  dur|j                  |d<   t        | |t        j                  di |       | j                  j                  d      i | _        ||   | j                  |<     y)	a  Make sure that stdlib `dataclasses` understands `Field` kwargs like `kw_only`
        To do that, we simply change
          `x: int = pydantic.Field(..., kw_only=True)`
        into
          `x: int = dataclasses.field(default=pydantic.Field(..., kw_only=True), kw_only=True)`
        __annotations__Ndefaultr    Tr-   r&   r1   )__mro__getattr
isinstancer   sysversion_infor-   r&   setattrdataclassesfield__dict__getr;   )clsannotation_clsr   
field_namefield_value
field_argss         r2   make_pydantic_fields_compatiblez2dataclass.<locals>.make_pydantic_fields_compatible   s     "kk 	JN*1.BSUW*XK) J
%c:t<!+y9 %.{#;
 ##w.;3F3F,0Jy) ##4/)4)9)9Jv&Z):):)HZ)HI <<##$56>*,C'2=j2I##J/-J	Jr3   c           
        ddl m}  ||       rt        d| j                   dd      | }t	        d | j
                  D              }|s.,t        | d	      r t        d
| j                   dt        d       nt        | d	d      }t        j                  |      }t        j                  j                  |       }| j                  }t!        j"                  |       rNd}| f}t%        | t&              rt&        | j(                     }	||	fz   }t+        j,                  | j                  |      }  |        /}
|j.                  r1t        d| j                  dt        d       n|j.                  xs d}
t1        j2                  | fd|
d} d| _        || _        || _        |j8                  | _        |j:                  | _        d| _        t!        j>                  | |d       | S )zCreate a Pydantic dataclass from a regular dataclass.

        Args:
            cls: The class to create the Pydantic dataclass from.

        Returns:
            A Pydantic dataclass.
        r   )is_model_classz(Cannot create a Pydantic dataclass from z" as it is already a Pydantic modelzdataclass-on-model)codec              3  F   K   | ]  }t        j                  |        y wr0   )rC   is_dataclass).0bases     r2   	<genexpr>z6dataclass.<locals>.create_dataclass.<locals>.<genexpr>   s      ZD!9!9$!? Zs   !N__pydantic_config__z[`config` is set via both the `dataclass` decorator and `__pydantic_config__` for dataclass zK. The `config` specification from `dataclass` decorator will take priority.   )category
stacklevelzN`frozen` is set via both the `dataclass` decorator and `config` for dataclass zW.This is not recommended. The `frozen` specification on `dataclass` will take priority.FT)r%   r&   r'   r(   r)   r*   )raise_errors) _internal._utilsrN   r   __name__any	__bases__hasattrr   UserWarningr>   r   ConfigWrapperr   DecoratorInfosbuild__doc___pydantic_dataclassesis_builtin_dataclass
issubclassr   __parameters__types	new_classr*   rC   r   __is_pydantic_dataclass____pydantic_decorators__
__module____qualname____pydantic_complete__complete_dataclass)rG   rN   original_clshas_dataclass_baseconfig_dictconfig_wrapper
decoratorsoriginal_docbasesgeneric_basefrozen_r+   r'   r*   kwargsrL   r(   r&   r)   s              r2   create_dataclassz#dataclass.<locals>.create_dataclass   s    	5##:3<<.Hjk) 
  ! ZCMM ZZ!f&8WSJ_=`mnqnznzm{ |\ ]$	 !' 2fEZ\`8a ..{; //55c:

 {{ 55c:  L
 FE#w'&s'9'9:///#,,6C', G$$deheqeqdt um m( 	 %++4uG##

 #

 

 )-%&0#"%00'44$)! 	00nSXY
r3   )rG   	type[Any]returnNone)rG   r{   r|   type[PydanticDataclass])r@   rA   )r5   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   rz   ry   rL   s     ``````    @@r2   r   r   a   sp    ^ 5=SSS5(Y*YY
7"$u5JB_ _B  $|G1A$1GGr3   )r!      c                     t        d      )a9  This function does nothing but raise an error that is as similar as possible to what you'd get
        if you were to try calling `InitVar[int]()` without this monkeypatch. The whole purpose is just
        to ensure typing._type_check does not error if the type hint evaluates to `InitVar[<parameter>]`.
        z 'InitVar' object is not callable)	TypeError)argsry   s     r2   _call_initvarr   #  s    
 :;;r3   rV   )forcerY   _parent_namespace_depth_types_namespacec               `   |s| j                   rydD ]  }|| j                  v st        | |        d| _         ||}n#|dkD  rt        j                  |d      xs i }ni }t        j                  |      }t        j                  | t        j                  | j                  d      ||d	      S )
ax  Try to rebuild the pydantic-core schema for the dataclass.

    This may be necessary when one of the annotations is a ForwardRef which could not be resolved during
    the initial attempt to build the schema, and automatic rebuilding fails.

    This is analogous to `BaseModel.model_rebuild`.

    Args:
        cls: The class to rebuild the pydantic-core schema for.
        force: Whether to force the rebuilding of the schema, defaults to `False`.
        raise_errors: Whether to raise errors, defaults to `True`.
        _parent_namespace_depth: The depth level of the parent namespace, defaults to 2.
        _types_namespace: The types namespace, defaults to `None`.

    Returns:
        Returns `None` if the schema is already "complete" and rebuilding was not required.
        If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`.
    N)__pydantic_core_schema____pydantic_validator____pydantic_serializer__Fr   T)parent_depthr   )parent_namespace)check)rY   ns_resolver_force_build)rn   rE   delattrr   parent_frame_namespacer   
NsResolverrd   ro   r   r`   rU   )rG   r   rY   r   r   attr
rebuild_nsr   s           r2   r   r   -  s    4 S..a 3<< C	 !&C#%
	 1	$"99G^fjkqoq

"--#K !33c55UC!
 
 
r3   c               l    	 d| j                   v xr t        j                  |       S # t        $ r Y yw xY w)zWhether a class is a pydantic dataclass.

    Args:
        class_: The class.

    Returns:
        `True` if the class is a pydantic dataclass, `False` otherwise.
    rj   F)rE   rC   rQ   AttributeError)class_s    r2   is_pydantic_dataclassr   j  s9    *foo=b+BZBZ[aBbb s   $' 	33)r%   Literal[False]r&   boolr'   r   r(   r   r)   r   r*   r   r+    ConfigDict | type[object] | Noner,   bool | Noner-   r   r.   r   r|   -Callable[[type[_T]], type[PydanticDataclass]])r5   type[_T]r%   r   r&   r   r'   r   r(   r   r)   r   r*   r   r+   r   r,   r   r-   r   r.   r   r|   r~   )r%   r   r&   r   r'   r   r(   r   r)   r   r*   r   r+   r   r,   r   r|   r   )r5   r   r%   r   r&   r   r'   r   r(   r   r)   r   r*   r   r+   r   r,   r   r|   r~   r0   )r5   ztype[_T] | Noner%   r   r&   r   r'   r   r(   r   r)   r   r*   r   r+   r   r,   r   r-   r   r.   r   r|   zGCallable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass])r   r   ry   r   r|   r	   )rG   r~   r   r   rY   r   r   intr   zMappingNamespace | Noner|   r   )r   r{   r|   z"TypeGuard[type[PydanticDataclass]])6rc   
__future__r   _annotationsrC   r@   rh   typingr   r   r   r   r   r	   r
   r   warningsr   typing_extensionsr   r   	_internalr   r   r   r   r   rd   
_migrationr   r+   r   errorsr   fieldsr   r   r   _internal._dataclassesr   _internal._namespace_utilsr   __all__r   rA   rD   r   r[   __getattr__r   InitVar__call__r   r   r1   r3   r2   <module>r      s   = 2  
  ^ ^ ^  < L L < )  % 1 19<
*T]w;+<+<e[*QR  %!37(,  	
    1 &   
7  S ;+<+<e[*QR  %!"37(,&& & 	&
 & & & & 1& && & & 
!&  S&" ;+<+<e[*QR  %!"37(,  	
    1 & 
7  S ;+<+<e[*QR  %!"37(,&& & 	&
 & & & & 1& && 
!&  S& {'8'8%&MN xH !/3$(xH
xH xH 	xH
 	xH xH xH xH -xH "xH xH xH MxH OxHv  )g< $1K  #$04:	 : : 	:
 !: .: :zr3   