+
    QV-jãG  ã                   ó^  a € R) t20 t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHtHtHt ^ RIt^ RIt^RIHt ^RIHt ^RIHt ^R	IHtHtHt ^R
IH t H!t!H"t" ]'       d   ^ RI#t$^RI%H&t& Rs'] ^ k ]PP                  R8X  d   RMRt)]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      ]PT                  ! R4      .t+] ! R R4      4       t,R R  lt-R! R" lt.R# R$ lt/R% R& lt0R' R( lt1R# )*é    N)Ú	dataclassÚfield)ÚBytesIO)ÚPath)ÚTYPE_CHECKINGÚAnyÚClassVarÚOptionalÚUnion)Úconfig)ÚDownloadConfig)Ú
array_cast)Úis_local_pathÚis_remote_urlÚxopen)Úfirst_non_null_valueÚno_op_if_value_is_nullÚstring_to_dict)ÚFeatureTypeÚlittleÚ<Ú>z|b1ú|u1z<u2z>u2z<i2z>i2z<u4z>u4z<i4z>i4z<f4z>f4z<f8z>f8c                   ó6  a € ] tR t^.t o RtRtRt]! RRR7      tRt	]
P                  ! R]
P                  ! 4       R]
P                  ! 4       /4      t]! R RRR	7      tR
 tV 3R lR ltRV 3R lR lltV 3R lR ltV 3R lR ltRV 3R lR lltV 3R ltRtV tR# )ÚImageaÉ  Image [`Feature`] to read image data from an image file.

Input: The Image feature accepts as input:
- A `str`: Absolute path to the image file (i.e. random access is allowed).
- A `pathlib.Path`: path to the image file (i.e. random access is allowed).
- A `dict` with the keys:

    - `path`: String with relative path of the image file to the archive file.
    - `bytes`: Bytes of the image file.

  This is useful for parquet or webdataset files which embed image files.

- An `np.ndarray`: NumPy array representing an image.
- A `PIL.Image.Image`: PIL image object.

Output: The Image features output data as `PIL.Image.Image` objects.

Args:
    mode (`str`, *optional*):
        The mode to convert the image to. If `None`, the native mode of the image is used.
    decode (`bool`, defaults to `True`):
        Whether to decode the image data. If `False`,
        returns the underlying dictionary in the format `{"path": image_path, "bytes": image_bytes}`.

Examples:

```py
>>> from datasets import load_dataset, Image
>>> ds = load_dataset("AI-Lab-Makerere/beans", split="train")
>>> ds.features["image"]
Image(decode=True, id=None)
>>> ds[0]["image"]
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x500 at 0x15E52E7F0>
>>> ds = ds.cast_column('image', Image(decode=False))
{'bytes': None,
 'path': '/root/.cache/huggingface/datasets/downloads/extracted/b0a21163f78769a2cf11f58dfc767fb458fc7cea5c05dccc0144a2c0f0bc1292/train/healthy/healthy_train.85.jpg'}
```
NTF)ÚdefaultÚreprúPIL.Image.ImageÚbytesÚpath)r   Úinitr   c                ó   € V P                   # ©N)Úpa_type)Úselfs   &Úh/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/datasets/features/image.pyÚ__call__ÚImage.__call___   s   € Ø�|‰|Ðó    c                ó^   <€ V ^8„  d   QhRS[ S[S[S[S[S[P                  R3,          RS[/# )é   Úvaluer   Úreturn)r   Ústrr   Ú	bytearrayÚdictÚnpÚndarray)ÚformatÚ__classdict__s   "€r&   Ú__annotate__ÚImage.__annotate__b   s3   ø€ ÷ 'ñ '¡E©#©u±iÁÁrÇzÁzÐSdÐ*dÕ$eð 'Ñjnñ 'r)   c                ó˜  € \         P                  '       d   ^ RIpM\        R4      h\	        V\
        4      '       d   \        P                  ! V4      p\	        V\        4      '       d   RVRR/# \	        V\        4      '       d   R\        VP                  4       4      RR/# \	        V\        \        34      '       d   RRRV/# \	        V\        P                  4      '       d   \        V4      # \	        WP                  P                  4      '       d   \!        V4      # VP#                  R4      eB   \$        P&                  P)                  VR,          4      '       d   RRRVP#                  R4      /# VP#                  R4      f   VP#                  R4      e%   RVP#                  R4      RVP#                  R4      /# \+        RV R24      h)zÐEncode example into a format for Arrow.

Args:
    value (`str`, `np.ndarray`, `PIL.Image.Image` or `dict`):
        Data passed as input to Image feature.

Returns:
    `dict` with "path" and "bytes" fields
Nú4To support encoding images, please install 'Pillow'.r    r   zUAn image sample should have one of 'path' or 'bytes' but they are missing or None in Ú.)r   ÚPIL_AVAILABLEÚ	PIL.ImageÚImportErrorÚ
isinstanceÚlistr1   Úarrayr.   r   Úabsoluter   r/   r2   Úencode_np_arrayr   Úencode_pil_imageÚgetÚosr    ÚisfileÚ
ValueError)r%   r,   ÚPILs   && r&   Úencode_exampleÚImage.encode_exampleb   so  € ô ××ÐÜäÐTÓUÐUä�eœT×"Ò"Ü—H’H˜U“OˆEä�eœS×!Ò!Ø˜E 7¨DÐ1Ð1Ü˜œt×$Ò$ØœC §¡Ó 0Ó1°7¸DÐAÐAÜ˜¤¤yÐ1×2Ò2Ø˜D '¨5Ð1Ð1Ü˜œrŸz™z×*Ò*ä" 5Ó)Ð)Ü˜Ÿy™yŸ™×/Ò/ä# EÓ*Ð*Ø�Y‰Y�vÓÒ*¬r¯w©w¯~©~¸eÀF½m×/LÒ/Là˜T 6¨5¯9©9°VÓ+<Ð=Ð=Ø�Y‰Y�wÓÒ+¨u¯y©y¸Ó/@Ò/Là˜UŸY™Y wÓ/°¸¿¹À6Ó9JÐKÐKäØgÐhmÐgnÐnoÐpóð r)   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r+   r,   r-   r   ©r0   )r3   r4   s   "€r&   r5   r6   ‹   s   ø€ ÷ ;ñ ;¡Dð ;ÐEVñ ;r)   c                ó  € V P                   '       g   \        R4      h\        P                  '       d
   ^ RIp^ RIpM\        R4      hVf   / pVR,          VR,          rTVEf(   Vf   \        RV R24      h\        V4      '       d   VP                  P                  V4      pEM
VP                  R4      R,          pVP                  \        P                  4      '       d   \        P                  M\        P                  p\!        Wx4      p	V	e   VP#                  V	R	,          4      MRp
\%        V
R
7      p\'        VRVR7      ;_uu_ 4       p\)        VP+                  4       4      pRRR4       VP                  P                  V4      pM$VP                  P                  \)        V4      4      pVP-                  4        VP/                  4       P#                  VP                  P0                  P2                  P4                  4      e   VP6                  P9                  V4      pV P:                  '       d7   V P:                  VP:                  8w  d   VP=                  V P:                  4      pV#   + '       g   i     EL; i)a	  Decode example image file into image data.

Args:
    value (`str` or `dict`):
        A string with the absolute image file path, a dictionary with
        keys:

        - `path`: String with absolute or relative image file path.
        - `bytes`: The bytes of the image file.
    token_per_repo_id (`dict`, *optional*):
        To access and decode
        image files from private repositories on the Hub, you can pass
        a dictionary repo_id (`str`) -> token (`bool` or `str`).

Returns:
    `PIL.Image.Image`
zMDecoding is disabled for this feature. Please use Image(decode=True) instead.Nz4To support decoding images, please install 'Pillow'.r    r   zCAn image should have one of 'path' or 'bytes' but both are None in r9   ú::Úrepo_id©ÚtokenÚrb©Údownload_configéÿÿÿÿ)ÚdecodeÚRuntimeErrorr   r:   r;   ÚPIL.ImageOpsr<   rF   r   r   ÚopenÚsplitÚ
startswithÚHF_ENDPOINTÚHUB_DATASETS_URLÚHUB_DATASETS_HFFS_URLr   rC   r   r   r   ÚreadÚloadÚgetexifÚExifTagsÚBaseÚOrientationÚImageOpsÚexif_transposeÚmodeÚconvert)r%   r,   Útoken_per_repo_idrG   r    Úbytes_ÚimageÚ
source_urlÚpatternÚsource_url_fieldsrP   rS   Úfs   &&&          r&   Údecode_exampleÚImage.decode_example‹   sæ  € ð$ �{�{ˆ{ÜÐnÓoÐoä××ÐÛÜäÐTÓUÐUàÒ$Ø "Ðà˜V•} e¨G¥nˆfØ‹>ØŠ|Ü Ð#fÐglÐfmÐmnÐ!oÓpÐpä  ×&Ò&ØŸI™IŸN™N¨4Ó0’Eà!%§¡¨DÓ!1°"Õ!5�Jð &×0Ñ0´×1CÑ1C×DÒDô ×/Ò/ä#×9Ñ9ð ô
 )7°zÓ(KÐ%àO`ÒOlÐ)×-Ñ-Ð.?À	Õ.JÔKÐrvð ô '5¸5Ô&A�OÜ˜t T¸?×KÕKÈqÜ!(¨¯©«Ó!2˜÷ LàŸI™IŸN™N¨6Ó2‘Eà—I‘I—N‘N¤7¨6£?Ó3ˆEØ�
‰
ŒØ�=‰=‹?×Ñ˜sŸy™y×1Ñ1×6Ñ6×BÑBÓCÒOØ—L‘L×/Ñ/°Ó6ˆEØ�9�9ˆ9˜Ÿ™ e§j¡jÔ0Ø—M‘M $§)¡)Ó,ˆEØˆ÷ L×KÐKús   ÅI-É-I>	c                óH   <€ V ^8„  d   QhRS[ RS[S[R3,          3,          /# )r+   r-   r   )r   r0   r.   )r3   r4   s   "€r&   r5   r6   È   s(   ø€ ÷ 
ñ 
™˜}©d±3¸Ð3EÕ.FÐFÕGñ 
r)   c                óZ   € ^RI Hp V P                  '       d   V # RV! R4      RV! R4      /# )zfIf in the decodable state, return the feature itself, otherwise flatten the feature into a dictionary.)ÚValuer   Úbinaryr    Ústring)Úfeaturesrs   rU   )r%   rs   s   & r&   ÚflattenÚImage.flattenÈ   s8   € å#ð �{�{ˆ{ð ð	
ð ™˜x›Ø™˜h›ðð	
r)   c                ó�   <€ V ^8„  d   QhRS[ S[P                  S[P                  S[P                  3,          RS[P                  /# )r+   Ústorager-   )r   ÚpaÚStringArrayÚStructArrayÚ	ListArray)r3   r4   s   "€r&   r5   r6   Õ   s:   ø€ ÷ <1ñ <1¡E©"¯.©.¹"¿.¹.É"Ï,É,Ð*VÕ$Wð <1Ñ\^×\jÑ\jñ <1r)   c           
     óÖ	  € \         P                  P                  VP                  4      '       d&    VP	                  \         P
                  ! 4       4      p\         P                  P                  VP                  4      '       dr   \         P                  ! R.\        V4      ,          \         P                  ! 4       R7      p\         P                  P                  W1.RR.VP                  4       R7      pEM°\         P                  P                  VP                  4      '       d‘   \!        V\         P                  ! 4       4      p\         P                  ! R.\        V4      ,          \         P
                  ! 4       R7      p\         P                  P                  W.RR.VP                  4       R7      pEMñ\         P                  P#                  VP                  4      '       dr   \         P                  ! R.\        V4      ,          \         P
                  ! 4       R7      p\         P                  P                  W.RR.VP                  4       R7      pEMQ\         P                  P%                  VP                  4      '       Ed   VP                  P'                  R4      ^ 8¼  d   VP)                  R4      pM<\         P                  ! R.\        V4      ,          \         P                  ! 4       R7      pVP                  P'                  R4      ^ 8¼  d   VP)                  R4      pM<\         P                  ! R.\        V4      ,          \         P
                  ! 4       R7      p\         P                  P                  W4.RR.VP                  4       R7      pEM\         P                  P+                  VP                  4      '       dâ   \         P                  ! VP-                  4        Uu. uF.  qUe'   \/        \0        P                  ! V4      4      R,          MRNK0  	  up\         P                  ! 4       R7      p\         P                  ! R.\        V4      ,          \         P
                  ! 4       R7      p\         P                  P                  W4.RR.VP                  4       R7      p\!        WP2                  4      #   \         P                   d   p\        RT 24      ThRp?ii ; iu upi )a  Cast an Arrow array to the Image arrow storage type.
The Arrow types that can be converted to the Image pyarrow storage type are:

- `pa.string()` - it must contain the "path" data
- `pa.large_string()` - it must contain the "path" data (will be cast to string if possible)
- `pa.binary()` - it must contain the image bytes
- `pa.struct({"bytes": pa.binary()})`
- `pa.struct({"path": pa.string()})`
- `pa.struct({"bytes": pa.binary(), "path": pa.string()})`  - order doesn't matter
- `pa.list(*)` - it must contain the image array data

Args:
    storage (`Union[pa.StringArray, pa.StructArray, pa.ListArray]`):
        PyArrow array to cast.

Returns:
    `pa.StructArray`: Array in the Image arrow storage type, that is
        `pa.struct({"bytes": pa.binary(), "path": pa.string()})`.
zvFailed to cast large_string to string for Image feature. This can happen if string values exceed 2GB. Original error: N©Útyper   r    ©Úmask)r{   ÚtypesÚis_large_stringr�   Úcastru   ÚArrowInvalidrF   Ú	is_stringr?   Úlenrt   r}   Úfrom_arraysÚis_nullÚis_large_binaryr   Ú	is_binaryÚ	is_structÚget_field_indexr   Úis_listÚ	to_pylistrA   r1   r$   )r%   rz   ÚeÚbytes_arrayÚ
path_arrayÚarrs   &&    r&   Úcast_storageÚImage.cast_storageÕ   sd  € ô( �8‰8×#Ñ# G§L¡L×1Ò1ðØ!Ÿ,™,¤r§y¢y£{Ó3�ô �8‰8×Ñ˜gŸl™l×+Ò+ÜŸ(š( D 6¬C°«LÕ#8¼r¿yºy»{ÔKˆKÜ—n‘n×0Ñ0°+Ð1GÈ'ÐSYÐIZÐah×apÑapÓarÐ0ÓsŠGÜ�X‰X×%Ñ% g§l¡l×3Ò3Ü ØœŸš›óˆGô Ÿš 4 &¬3¨w«<Õ"7¼b¿iºi»kÔJˆJÜ—n‘n×0Ñ0°'Ð1FÈÐRXÐHYÐ`g×`oÑ`oÓ`qÐ0ÓrŠGÜ�X‰X×Ñ §¡×-Ò-ÜŸš 4 &¬3¨w«<Õ"7¼b¿iºi»kÔJˆJÜ—n‘n×0Ñ0°'Ð1FÈÐRXÐHYÐ`g×`oÑ`oÓ`qÐ0ÓrŠGÜ�X‰X×Ñ §¡×-Ó-Ø�|‰|×+Ñ+¨GÓ4¸Ô9Ø%Ÿm™m¨GÓ4‘ä Ÿhšh¨ v´°G³Õ'<Ä2Ç9Â9Ã;ÔO�Ø�|‰|×+Ñ+¨FÓ3°qÔ8Ø$Ÿ]™]¨6Ó2‘
äŸXšX t f¬s°7«|Õ&;Ä"Ç)Â)Ã+ÔN�
Ü—n‘n×0Ñ0°+Ð1JÈWÐV\ÐL]Ðdk×dsÑdsÓduÐ0ÓvŠGÜ�X‰X×Ñ˜gŸl™l×+Ò+ÜŸ(š(Øah×arÑarÔatÓuÑatÐZ]ºO”¤§¢¨#£Ó/°Ö8ÐQUÒUÑatÑuÜ—Y’Y“[ôˆKô Ÿš 4 &¬3¨w«<Õ"7¼b¿iºi»kÔJˆJÜ—n‘n×0Ñ0ØÐ)¨G°VÐ+<À;×CVÑCVÓCXð 1ó ˆGô ˜'§<¡<Ó0Ð0øôK —?‘?ô Ü ð'à'( cð+óð ð	ûðüò< vs   ±$R: Ï&4S&Ò:S#ÓSÓS#c                óZ   <€ V ^8„  d   QhRS[ P                  RS[RS[RS[ P                  /# )r+   rz   Úlocal_filesÚremote_filesr-   )r{   r}   Úbool)r3   r4   s   "€r&   r5   r6     s;   ø€ ÷ C1ñ C1Ù—~‘~ðC1ÙLPðC1ÙgkðC1á	�‰ñC1r)   c           	     ó�  a€ Sf   / o\         V3R l4       p\        P                  ! VP                  4        Uu. uFl  pVed   VR,          fP   V'       d   \	        VR,          4      '       g!   V'       d(   \        VR,          4      '       d   V! VR,          4      M
VR,          MRNKn  	  up\        P                  ! 4       R7      p\        P                  ! VP                  R4      P                  4        Uu. uF\  pVeT   V'       d   \	        V4      '       g   V'       d1   \        V4      '       d    \        P                  P                  V4      MTMRNK^  	  up\        P                  ! 4       R7      p	\        P                  P                  Wy.RR.VP                  4       R7      p\        WP                   4      # u upi u upi )a·  Embed image files into the Arrow array.

Args:
    storage (`pa.StructArray`):
        PyArrow array to embed.
    token_per_repo_id (`dict`, optional):
        Dictionary repo_id -> token to fetch the files bytes.
    local_files (`bool`, defaults to `True`)
        Whether to embed local files data in the array

        <Added version="4.8.5"/>
    remote_files (`bool`, defaults to `True`)
        Whether to embed remote files data in the array.
        E.g. files with paths that start with hf:// or https://

        <Added version="4.8.5"/>

Returns:
    `pa.StructArray`: Array in the Image arrow storage type, that is
        `pa.struct({"bytes": pa.binary(), "path": pa.string()})`.
Nc                 ó²  <€ V P                  R 4      R,          pVP                  \        P                  4      '       d   \        P                  M\        P
                  p\        W4      pVe   SP                  VR,          4      MRp\        VR7      p\        V RVR7      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)rM   NrN   rO   rQ   rR   rT   )rY   rZ   r   r[   r\   r]   r   rC   r   r   r^   )r    rk   rl   rm   rP   rS   rn   rh   s   &      €r&   Úpath_to_bytesÚ*Image.embed_storage.<locals>.path_to_bytes.  s£   ø€ àŸ™ DÓ)¨"Õ-ˆJà+5×+@Ñ+@Ä×ASÑAS×+TÒ+T”×'Ò'ÔZ`×ZvÑZvð ô !/¨zÓ CÐØK\ÒKhÐ%×)Ñ)Ð*;¸IÕ*FÔGÐnrˆEÜ,°5Ô9ˆOÜ�t˜T°?×CÕCÀqØ—v‘v“x÷ D×C×CÓCús   Â*CÃC	r   r    r€   r‚   )r   r{   r?   r‘   r   r   rt   r   rD   r    Úbasenameru   r}   rŠ   r‹   r   r$   )
r%   rz   rh   r™   rš   rž   Úxr“   r    r”   s
   &&f&&     r&   Úembed_storageÚImage.embed_storage  s”  ø€ ð0 Ò$Ø "Ðä	ô		 ó 
 ð		 ô —h’hð !×*Ñ*Ô,ó
ñ -�Að ’=ð	 ˜•zÒ)ß%¬-¸¸&½	×*BÒ*BÏÔYfÐghÐioÕgp×YqÒYqñ " ! F¥)Ô,ð ˜7žð òñ -ñ
ô —’“ô
ˆô —X’Xð $ŸM™M¨&Ó1×;Ñ;Ô=ó	ñ >�Dð Ò#÷ $¬°d×(;Ò(;ÇÔR_Ð`d×ReÒReô —G‘G×$Ñ$ TÔ*áð òñ >ñ	ô —’“ô
ˆ
ô —.‘.×,Ñ,¨kÐ-FÈÐRXÐHYÐ`g×`oÑ`oÓ`qÐ,ÓrˆÜ˜'§<¡<Ó0Ð0ùò7
ùò	s#   ¹F>ÁF>Á56F>Ã8GÄ	GÄ"8Gc                ó¢   <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[;R&   S[ S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   S[;R&   # )r+   rf   rU   ÚidÚdtyper$   Ú_type)r
   r.   r›   r	   r   )r3   r4   s   "€r&   r5   r6   .   so   ø‡ ‚ ñR ‘3�-ÑñS ñT ÑñU ñV 	‘�Ñ7ñW ñZ ‘C�=Ñ,ñ[ ñ\ ‘c�]ÑSñ] ñ^ Ñ?ò_ r)   © r#   )NTT)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rf   rU   r   r¥   r¦   r{   Ústructrt   ru   r$   r§   r'   rH   ro   rw   r–   r¢   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r4   s   @r&   r   r   .   s�   ø‡ € ñ%ðN €DØ€FÙ d°Ô7€Bà,€EØŸYšY¨°·²³¸fÀbÇiÂiÃkÐ'RÓS€GÙ˜w¨U¸Ô?€Eò÷'ð '÷R;ò ;÷z
ð 
÷<1ð <1÷|C1ò C1÷K ƒ r)   r   c                ó:   € V ^8„  d   QhR\         \        ,          /# )r+   r-   )r>   r.   )r3   s   "r&   r5   r5   Y  s   € ÷ 
&ñ 
&¬¬S­	ñ 
&r)   c                  ón  € \         P                  '       d   ^ RIp M\        R4      h\        fƒ   V P
                  P                  4        \        \        V P
                  P                  P                  4       4      \        V P
                  P                  P                  4       4      ,          4      s\        # )r   Nr8   )r   r:   r;   r<   Ú_IMAGE_COMPRESSION_FORMATSr   r!   r>   ÚsetÚOPENÚkeysÚSAVE)rG   s    r&   Úlist_image_compression_formatsr¹   Y  su   € Ü××ÐÜäÐPÓQÐQô "Ò)Ø�	‰	�‰ÔÜ%)¬#¨c¯i©i¯n©n×.AÑ.AÓ.CÓ*DÄsÈ3Ï9É9Ï>É>×K^ÑK^ÓK`ÓGaÕ*aÓ%bÐ"Ü%Ð%r)   c                ó(   € V ^8„  d   QhRRR\         /# ©r+   rj   r   r-   )r   )r3   s   "r&   r5   r5   f  s   € ÷ ñ Ð+ð ´ñ r)   c                óÐ   € \        4       pV P                  \        4       9   d   V P                  pMV P                  R9   d   RMRpV P	                  WR7       VP                  4       # )zmConvert a PIL Image object to bytes using native compression if possible, otherwise use PNG/TIFF compression.ÚPNGÚTIFF)r3   )Ú1ÚLÚLAÚRGBÚRGBA)r   r3   r¹   rf   ÚsaveÚgetvalue)rj   Úbufferr3   s   &  r&   Úimage_to_bytesrÇ   f  sP   € ä‹Y€FØ‡|�|Ô5Ó7Ô7Ø—‘‰àŸ*™*Ð(GÔG‘ÈVˆØ	‡J�Jˆv€JÔ%Ø�?‰?ÓÐr)   c                ó(   € V ^8„  d   QhRRR\         /# r»   rK   )r3   s   "r&   r5   r5   q  s   € ÷ >ñ >Ð-ð >´$ñ >r)   c                 ó†   € \        V R 4      '       d"   V P                  R8w  d   RV P                  RR/# RRR\        V 4      /# )ÚfilenameÚ r    r   N)ÚhasattrrÊ   rÇ   )rj   s   &r&   rB   rB   q  sA   € Üˆu�j×!Ò! e§n¡n¸Ô&:Ø˜Ÿ™¨°Ð6Ð6à˜˜g¤~°eÓ'<Ð=Ð=r)   c                óD   € V ^8„  d   QhR\         P                  R\        /# )r+   r?   r-   )r1   r2   r0   )r3   s   "r&   r5   r5   x  s   € ÷ (:ñ (:œ2Ÿ:™:ð (:¬$ñ (:r)   c                 ór  € \         P                  '       d   ^ RIpM\        R4      hV P                  pVP
                  R8w  d   VP
                  M\        pVP                  pVP                  pRpV P                  R,          '       dT   VR9  d   \        RV RV R24      h\        P                  ! R4      pW&8w  d   \        P                  ! R	V R
V R24       M¤V\        9   d   TpM–V^8¼  dw   W4,           \        V4      ,           p\        P                  ! V4      \        9   d5   \        P                  ! V4      p\        P                  ! R	V R
V R24       MV^,          pK}  Vf   \        RV R\         24      hVP                   P#                  V P%                  V4      4      pRRR\'        V4      /# )r   Nr8   Ú=:r+   NNzUnsupported array dtype z for image encoding. Only z' is supported for multi-channel arrays.r   zDowncasting array dtype z to z to be compatible with 'Pillow'zCannot downcast dtype z- to a valid image dtype. Valid image dtypes: r    r   )ÚuÚi)r   r:   r;   r<   r¦   Ú	byteorderÚ_NATIVE_BYTEORDERÚkindÚitemsizeÚshapeÚ	TypeErrorr1   ÚwarningsÚwarnÚ_VALID_IMAGE_ARRAY_DTPYESr.   r   Ú	fromarrayÚastyperÇ   )	r?   rG   r¦   Údtype_byteorderÚ
dtype_kindÚdtype_itemsizeÚ
dest_dtypeÚ	dtype_strrj   s	   &        r&   rA   rA   x  sŠ  € Ü××ÐÜäÐPÓQÐQà�K‰K€EØ).¯©¸CÔ)?�e—o’oÔEV€OØ—‘€JØ—^‘^€Nà€Jð ‡{�{�2‡„Ø˜ZÔ'ÜØ*¨5¨'Ð1KÈJÈ<ÐW~Ðóð ô —X’X˜e“_ˆ
ØÔÜ�MŠMÐ4°U°G¸4À
¸|ÐKjÐkÔløà	Ô+Ô	+Ø‰
à Ô!Ø'Õ4´s¸>Ó7JÕJˆIÜ�xŠx˜	Ó"Ô&?Ô?ÜŸXšX iÓ0�
Ü—’Ð 8¸¸¸tÀJÀ<ÐOnÐoÔpØà 1Õ$’ØÒÜØ(¨¨Ð/\Ô]vÐ\wÐxóð ð �I‰I×Ñ §¡¨ZÓ 8Ó9€EØ�D˜'¤>°%Ó#8Ð9Ð9r)   c                óà   € V ^8„  d   QhR\         \        \        ,          \        \        ,          \        \        P
                  ,          \        R,          3,          R\        \        ,          /# )r+   Úobjsr   r-   )r   r>   r.   r0   r1   r2   )r3   s   "r&   r5   r5   £  sE   € ÷ ñ Ü
””S•	œ4¤�:¤t¬B¯J©JÕ'7¼Ð>OÕ9PÐPÕ
Qðä	Œ$…Zñr)   c                ó"  € \         P                  '       d   ^ RIpM\        R4      hV '       dÒ   \	        V 4      w  r#\        V\        4      '       d   V  Uu. uF  q3e   RVRR/MRNK  	  up# \        V\        P                  4      '       d'   \        \        4      pV  Uu. uF
  q4! V4      NK  	  up# \        W1P                  P                  4      '       d'   \        \        4      pV  Uu. uF
  q4! V4      NK  	  up# V # V # u upi u upi u upi )zmEncode a list of objects into a format suitable for creating an extension array of type `ImageExtensionType`.Nr8   r    r   )r   r:   r;   r<   r   r=   r.   r1   r2   r   rA   r   rB   )rã   rG   Ú_ÚobjÚobj_to_image_dict_funcs   &    r&   Úobjects_to_list_of_image_dictsrè   £  sð   € ô ××ÐÜäÐPÓQÐQçÜ% dÓ+‰ˆÜ�cœ3×ÒÙY]Ó^ÑY]ÐRU²O�V˜S '¨4Ñ0ÈÒMÑY]Ñ^Ð^Ü�cœ2Ÿ:™:×&Ò&Ü%;¼OÓ%LÐ"Ù;?Ó@¹4°CÐ*¨3Ö/¹4Ñ@Ð@Ü˜ŸY™YŸ_™_×-Ò-Ü%;Ô<LÓ%MÐ"Ù;?Ó@¹4°CÐ*¨3Ö/¹4Ñ@Ð@àˆKàˆùò _ùò Aùò As   ÁDÂ DÃ+Dc                ól   € V ^8„  d   Qh/ ^ \         9   d    \        \        \        ,          ,          ;R&   # )r+   r´   )Ú__conditional_annotations__r
   r>   r.   )r3   s   "r&   r5   r5      s!   € ‡	�	÷0 7Ò 6œH¤T¬#¥YÕ/Ñ 6ò1 
r)   )3rê   rD   ÚsysrØ   Údataclassesr   r   Úior   Úpathlibr   Útypingr   r   r	   r
   r   Únumpyr1   Úpyarrowr{   rË   r   Údownload.download_configr   Útabler   Úutils.file_utilsr   r   r   Úutils.py_utilsr   r   r   r;   rG   rv   r   r´   rÒ   rÓ   r¦   rÚ   r   r¹   rÇ   rB   rA   rè   r5   )rê   s   @r&   Ú<module>rö      s?  øðß 	€	Û 
Û ß (Ý Ý ß @Õ @ã Û å Ý 5Ý ß BÑ Bß YÑ Y÷ Ûå%ð 37Ð Ó 6ØŸ=™=¨HÔ4‘C¸#Ð ð ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOØ‡H‚HˆUƒOðÐ ð$ ÷g1ð g1ó ðg1õT	
&õõ>õ(:÷Vr)   