Ë
    Q^(hW  ã                   óò   — U d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
mZ e	gZee   ed<   ej                  dk\  rddlmZ eegz  Zed   Z ede¬	«      Zeeee ed«      fZd
edefd„Zdedefd„Zdedefd„Zy)z4Handle typing imports based on system compatibility.é    N)	ÚAnyÚCallableÚListÚLiteralÚTypeÚTypeVarÚUnionÚget_argsÚ
get_originÚUNION_TYPES)é   é
   )Ú	UnionType)ÚGETÚOPTIONSÚHEADÚPOSTÚPUTÚPATCHÚDELETEÚ	CallableT)ÚboundÚobjÚreturnc                 ó  — 	 t        | t        «      ryt        | t        t        f«      rt	        d„ | D «       «      S t        | t
        «      r t	        d„ | j                  «       D «       «      S t        | d«      ryy# t        $ r Y yw xY w)a  Check if an object is JSON serializable.

    This is a weak check, as it does not check for the actual JSON serialization, but only for the types of the object.
    It works correctly for basic use cases but do not guarantee an exhaustive check.

    Object is considered to be recursively json serializable if:
    - it is an instance of int, float, str, bool, or NoneType
    - it is a list or tuple and all its items are json serializable
    - it is a dict and all its keys are strings and all its values are json serializable
    Tc              3   ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Úis_jsonable)Ú.0Úitems     ú[/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/huggingface_hub/utils/_typing.pyú	<genexpr>zis_jsonable.<locals>.<genexpr>3   s   è ø€ Ò9¨T”{ 4×(Ñ9ùs   ‚c              3   ó\   K  — | ]$  \  }}t        |t        «      xr t        |«      –— Œ& y ­wr   )Ú
isinstanceÚ_JSON_SERIALIZABLE_TYPESr   )r   ÚkeyÚvalues      r!   r"   zis_jsonable.<locals>.<genexpr>5   s-   è ø€ ÒvÑ\fÐ\_Ðaf”z #Ô'?Ó@ÒWÄ[ÐQVÓEWÓWÑvùs   ‚*,Ú__json__F)	r$   r%   ÚlistÚtupleÚallÚdictÚitemsÚhasattrÚRecursionError)r   s    r!   r   r   $   s{   € ðÜ�cÔ3Ô4ØÜ�cœD¤%˜=Ô)ÜÑ9°SÔ9Ó9Ð9Ü�cœ4Ô ÜÑvÐjm×jsÑjsÓjuÔvÓvÐvÜ�3˜
Ô#ØØøÜò Ùðús!   ‚A9 “'A9 »/A9 Á+A9 Á9	BÂBÚtype_c                 ót   — t        | «      t        v r't        | «      }t        |«      dk(  rt	        d«      |v ryy)zyCheck if a type is optional, i.e. Optional[Type] or Union[Type, None] or Type | None, where Type is a non-composite type.é   NTF)r   r   r
   ÚlenÚtype)r0   Ú
union_argss     r!   Úis_simple_optional_typer6   =   s5   € ä�%ÓœKÑ'Ü˜e“_ˆ
Üˆz‹?˜aÒ¤D¨£J°*Ñ$<ØØó    Úoptional_typec                 ób   — t        | «      D ]  }|t        d«      usŒ|c S  t        d| › d�«      ‚)zFUnwraps a simple optional type, i.e. returns Type from Optional[Type].Nú'z' is not an optional type)r
   r4   Ú
ValueError)r8   Úargs     r!   Úunwrap_simple_optional_typer=   F   s>   € ä˜Ó&ò ˆØ”d˜4“jÒ ØŠJðô �q˜˜Ð'@ÐAÓ
BÐBr7   )Ú__doc__ÚsysÚtypingr   r   r   r   r   r   r	   r
   r   r   Ú__annotations__Úversion_infoÚtypesr   ÚHTTP_METHOD_Tr   ÚintÚfloatÚstrÚboolr4   r%   r   r6   r=   © r7   r!   ú<module>rJ      s±   ðò ;ã 
ß [× [Õ [ð  ˜€ˆT�#‰YÓ  Ø×Ñ�wÒÝà�I�;Ñ€Kð ÐRÑS€ñ �K xÔ0€	à ¨¨T±4¸³:Ð>Ð ð�Sð ˜Tó ð2 4ð ¨Dó ðC¨tð C¸ô Cr7   