+
    LV-jf  ã                   óÌ  € ^ RI t ^ RIt^ RIt^ RIt^ RIt . R*Ot] P                  ! R4      t] P                  ! R4      t	] P                  ! R4      t
] P                  ! R4      t] P                  ! R	4      t] P                  ! R
4      t] P                  ! R4      t] P                  ! R4      t] P                  ! R4      t] P                  ! R4      t] P                  ! R4      t ! R R]4      t ! R R]4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR tR tR  tR+R! ltR" t R# t!R$ t"R% t#R& t$ ! R' R4      t%R( t&R) t'R# ),é    NÚMetaDataÚ	ArffErrorÚParseArffErrorz^\s*@z^%z^\s+$z^\s*@\S*z^@[Dd][Aa][Tt][Aa]z*^@[Rr][Ee][Ll][Aa][Tt][Ii][Oo][Nn]\s*(\S*)z2^\s*@[Aa][Tt][Tt][Rr][Ii][Bb][Uu][Tt][Ee]\s*(..*$)z{(.+)}z%[Dd][Aa][Tt][Ee]\s+[\"']?(.+?)[\"']?$z'(..+)'\s+(..+$)z(\S+)\s+(..+$)c                   ó   € ] tR t^6tRtRtR# )r   z�
Base exception for errors when reading ARFF files.

Raised when an ARFF file cannot be read due to file access issues,
corruption, or unsupported features.
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Úh/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/io/arff/_arffread.pyr   r   6   ó   † ñó 	r   c                   ó   € ] tR t^@tRtRtR# )r   z¬
Exception for syntax and parsing errors in ARFF files.

Raised when an ARFF file has invalid syntax, malformed attributes,
or data that doesn't match the expected format.
r   Nr   r   r   r   r   r   @   r   r   c                   óF   a € ] tR t^Mt o RtR t]R 4       tR tR t	Rt
V tR# )Ú	AttributeNc                óJ   € Wn         R V n        \        P                  V n        R # ©N)ÚnameÚrangeÚnpÚobject_Údtype)Úselfr   s   &&r   Ú__init__ÚAttribute.__init__Q   s   € ØŒ	ØˆŒ
Ü—Z‘ZˆŽ
r   c                ó   € R# )zR
Parse the attribute line if it knows how. Returns the parsed
attribute, or None.
Nr   ©Úclsr   Úattr_strings   &&&r   Úparse_attributeÚAttribute.parse_attributeV   s   € ñ r   c                ó   € R# )ú
Parse a value of this type.
Nr   ©r   Údata_strs   &&r   Ú
parse_dataÚAttribute.parse_data^   s   € ñ r   c                óJ   € V P                   R,           V P                  ,           # )r&   Ú,)r   Ú	type_name©r   s   &r   Ú__str__ÚAttribute.__str__d   s   € ð �y‰y˜3� §¡Õ/Ð/r   )r   r   r   )r	   r
   r   r   r-   r   Úclassmethodr#   r)   r/   r   Ú__classdictcell__©Ú__classdict__s   @r   r   r   M   s2   ø‡ € à€Iò ð
 ñó ðò÷0ð 0r   r   c                   ób   a a€ ] tR t^kt oRtV 3R lt]R 4       t]R 4       t	R t
R tRtVtV ;t# )ÚNominalAttributeÚnominalc                óŒ   <€ \         SV `  V4       W n        W n        \        P
                  \        R  V 4       4      3V n        R# )c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir   )Úlen)Ú.0Úis   & r   Ú	<genexpr>Ú,NominalAttribute.__init__.<locals>.<genexpr>s   s   é € Ð$<±V°¤S¨§V V³Vùó   ‚N)Úsuperr   Úvaluesr   r   Úbytes_Úmaxr   )r   r   rA   Ú	__class__s   &&&€r   r   ÚNominalAttribute.__init__o   s5   ø€ Ü‰Ñ˜ÔØŒØŒ
Ü—i‘i¤Ñ$<±VÓ$<Ó!<Ð=ˆŽ
r   c                ó    € \         P                  V 4      pV'       d(   \        VP                  ^4      4      w  r#\	        V4      # \        R4      h)a¸  Given a string containing a nominal type, returns a tuple of the
possible values.

A nominal type is defined as something framed between braces ({}).

Parameters
----------
atrv : str
   Nominal type definition

Returns
-------
poss_vals : tuple
   possible values

Examples
--------
>>> from scipy.io.arff._arffread import NominalAttribute
>>> NominalAttribute._get_nom_val("{floup, bouga, fl, ratata}")
('floup', 'bouga', 'fl', 'ratata')
z(This does not look like a nominal string)Ú	r_nominalÚmatchÚsplit_data_lineÚgroupÚtupleÚ
ValueError)ÚatrvÚmÚattrsÚ_s   &   r   Ú_get_nom_valÚNominalAttribute._get_nom_valu   s?   € ô. �O‰O˜DÓ!ˆßÜ& q§w¡w¨q£zÓ2‰HˆEÜ˜“<ÐäÐGÓHÐHr   c                óT   € V^ ,          R8X  d   V P                  V4      pV ! W4      # R# )z°
Parse the attribute line if it knows how. Returns the parsed
attribute, or None.

For nominal attributes, the attribute string would be like '{<attr_1>,
 <attr2>, <attr_3>}'.
Ú{N)rQ   )r!   r   r"   rA   s   &&& r   r#   Ú NominalAttribute.parse_attribute“   s.   € ð �q�>˜SÔ Ø×%Ñ% kÓ2ˆFÙ�tÓ$Ð$ár   c                ó�   € WP                   9   d   V# VR8X  d   V# \        \        V4       R\        V P                   4       24      h)r&   Ú?z value not in )rA   rL   Ústrr'   s   &&r   r)   ÚNominalAttribute.parse_data¢   sC   € ð —{‘{Ô"ØˆOØ˜Œ_ØˆOä¤ H£˜¨n¼SÀÇÁÓ=MÐ<NÐOÓPÐPr   c                ó  € V P                   R ,           p\        \        V P                  4      ^,
          4       F#  pWP                  V,          R,           ,          pK%  	  WP                  R,          ,          pVR,          pV# )z,{r,   Ú}éÿÿÿÿ)r   r   r:   rA   ©r   Úmsgr<   s   &  r   r/   ÚNominalAttribute.__str__­   s`   € Ø�i‰i˜$ÕˆÜ”s˜4Ÿ;™;Ó'¨Õ)Ö*ˆAØ—;‘;˜q•> CÕ'Õ'ŠCñ +à�{‰{˜2�ÕˆØˆs�
ˆØˆ
r   )r   r   rA   )r	   r
   r   r   r-   r   ÚstaticmethodrQ   r1   r#   r)   r/   r   r2   Ú__classcell__©rD   r4   s   @@r   r6   r6   k   sI   ù‡ € à€Iõ>ð ñIó ðIð: ñó ðò	Q÷ò r   r6   c                   óN   a a€ ] tR t^¶t oV 3R lt]R 4       tR tR tRt	Vt
V ;t# )ÚNumericAttributec                ó^   <€ \         SV `  V4       R V n        \        P                  V n        R# )ÚnumericN)r@   r   r-   r   Úfloat64r   ©r   r   rD   s   &&€r   r   ÚNumericAttribute.__init__¸   s"   ø€ Ü‰Ñ˜ÔØ"ˆŒÜ—Z‘ZˆŽ
r   c                óÄ   € VP                  4       P                  4       pVR\        R4       R8X  g'   VR\        R4       R8X  g   VR\        R4       R8X  d	   V ! V4      # R# )z¬
Parse the attribute line if it knows how. Returns the parsed
attribute, or None.

For numeric attributes, the attribute string would be like
'numeric' or 'int' or 'real'.
Nrf   ÚintÚreal©ÚlowerÚstripr:   r    s   &&&r   r#   Ú NumericAttribute.parse_attribute½   sa   € ð "×'Ñ'Ó)×/Ñ/Ó1ˆà˜œ˜Y›Ð(¨IÔ5Ø�{œ˜E›
Ð# uÔ,Ø�|œ˜F›Ð$¨Ô.Ù�t“9Ðár   c                óF   € RV9   d   \         P                  # \        V4      # )aS  
Parse a value of this type.

Parameters
----------
data_str : str
   string to convert

Returns
-------
f : float
   where float can be nan

Examples
--------
>>> from scipy.io.arff._arffread import NumericAttribute
>>> atr = NumericAttribute('atr')
>>> atr.parse_data('1')
1.0
>>> atr.parse_data('1\n')
1.0
>>> atr.parse_data('?\n')
nan
rW   )r   ÚnanÚfloatr'   s   &&r   r)   ÚNumericAttribute.parse_dataÐ   s   € ð2 �(Œ?Ü—6‘6ˆMä˜“?Ð"r   c                ó  € VP                   R ,          VP                   ^,
          ,          p\        P                  ! V4      \        P                  ! V4      \        P                  ! V4      \        P
                  ! V4      V,          3# )g      ð?)Úsizer   ÚnanminÚnanmaxÚmeanÚstd)r   ÚdataÚnbfacs   && r   Ú_basic_statsÚNumericAttribute._basic_statsî   sU   € Ø—	‘	˜B• $§)¡)¨a¥-Õ0ˆÜ—	’	˜$“¤§¢¨4£Ü—’˜“œrŸvšv d›|¨eÕ3ð5ð 	5r   )r   r-   )r	   r
   r   r   r   r1   r#   r)   r}   r   r2   ra   rb   s   @@r   rd   rd   ¶   s-   ù‡ € õ ð
 ñó ðò$#÷<5ò 5r   rd   c                   óB   a a€ ] tR t^ôt oV 3R lt]R 4       tRtVtV ;t	# )ÚStringAttributec                ó4   <€ \         SV `  V4       R V n        R# )ÚstringN)r@   r   r-   rh   s   &&€r   r   ÚStringAttribute.__init__ö   s   ø€ Ü‰Ñ˜ÔØ!ˆŽr   c                óx   € VP                  4       P                  4       pVR\        R4       R8X  d	   V ! V4      # R# )z—
Parse the attribute line if it knows how. Returns the parsed
attribute, or None.

For string attributes, the attribute string would be like
'string'.
Nr‚   rm   r    s   &&&r   r#   ÚStringAttribute.parse_attributeú   s;   € ð "×'Ñ'Ó)×/Ñ/Ó1ˆà�~œ˜H›Ð&¨(Ô2Ù�t“9Ðár   )r-   )
r	   r
   r   r   r   r1   r#   r   r2   ra   rb   s   @@r   r€   r€   ô   s#   ù‡ € õ"ð ñó ÷ð r   r€   c                   ód   a a€ ] tR tRt oV 3R lt]R 4       t]R 4       tR t	V 3R lt
RtVtV ;t# )ÚDateAttributei  c                ó¤   <€ \         SV `  V4       W n        W0n        R V n        W n        \        P                  ! ^ V P                  4      V n        R# )ÚdateN)	r@   r   Údate_formatÚdatetime_unitr-   r   r   Ú
datetime64r   )r   r   rŠ   r‹   rD   s   &&&&€r   r   ÚDateAttribute.__init__  s@   ø€ Ü‰Ñ˜ÔØ&ÔØ*ÔØˆŒØ Œ
Ü—]’] 1 d×&8Ñ&8Ó9ˆŽ
r   c                ó\  € \         P                  V 4      pV'       Ed   VP                  ^4      P                  4       pRpRV9   d   VP	                  RR4      pRpM VP	                  RR4      pRpRV9   d   VP	                  RR4      pR	pR
V9   d   VP	                  R
R4      pRpRV9   d   VP	                  RR4      pRpRV9   d   VP	                  RR4      pRpRV9   d   VP	                  RR4      pRpRV9   g   RV9   d   \        R4      hVf   \        R4      hW#3# \        R4      h)é   NÚyyyyz%YÚYÚyyz%yÚMMz%mÚMÚddz%dÚDÚHHz%HÚhÚmmz%MrN   Ússz%SÚsÚzÚZz6Date type attributes with time zone not supported, yetz"Invalid or unsupported date formatzInvalid or no date format)Úr_daterH   rJ   ro   ÚreplacerL   )rM   rN   Úpatternr‹   s   &   r   Ú_get_date_formatÚDateAttribute._get_date_format  s9  € ä�L‰L˜Óˆßˆ1Ø—g‘g˜a“j×&Ñ&Ó(ˆGà ˆMØ˜Ô Ø!Ÿ/™/¨&°$Ó7�Ø #‘ØØ!Ÿ/™/¨$°Ó5�Ø #�Ø�wŒØ!Ÿ/™/¨$°Ó5�Ø #�Ø�wŒØ!Ÿ/™/¨$°Ó5�Ø #�Ø�wŒØ!Ÿ/™/¨$°Ó5�Ø #�Ø�wŒØ!Ÿ/™/¨$°Ó5�Ø #�Ø�wŒØ!Ÿ/™/¨$°Ó5�Ø #�Ø�gŒ~ ¨¤Ü ð "2ó 3ð 3ð Ò$Ü Ð!EÓFÐFàÐ)Ð)äÐ8Ó9Ð9r   c                ó    € VP                  4       P                  4       pVR\        R4       R8X  d   V P                  V4      w  rEV ! WV4      # R# )úœ
Parse the attribute line if it knows how. Returns the parsed
attribute, or None.

For date attributes, the attribute string would be like
'date <format>'.
Nr‰   )rn   ro   r:   r¡   )r!   r   r"   Úattr_string_lowerrŠ   r‹   s   &&&   r   r#   ÚDateAttribute.parse_attribute=  sR   € ð (×-Ñ-Ó/×5Ñ5Ó7Ðà˜\œc &›kÐ*¨fÔ4Ø),×)=Ñ)=¸kÓ)JÑ&ˆKÙ�t¨-Ó8Ð8ár   c                óf  € VP                  4       P                  R4      P                  R4      pVR8X  d"   \        P                  ! RV P                  4      # \        P                  P                  W P                  4      p\        P                  ! V4      P                  RV P                   R24      # )r&   Ú'Ú"rW   ÚNaTzdatetime64[Ú])ro   r   rŒ   r‹   ÚdatetimeÚstrptimerŠ   Úastype)r   r(   Údate_strÚdts   &&  r   r)   ÚDateAttribute.parse_dataO  s�   € ð —>‘>Ó#×)Ñ)¨#Ó.×4Ñ4°SÓ9ˆØ�sŒ?Ü—=’= ¨×(:Ñ(:Ó;Ð;ä×"Ñ"×+Ñ+¨H×6FÑ6FÓGˆBÜ—=’= Ó$×+Ñ+Ø˜d×0Ñ0Ð1°Ð3ó5ð 5r   c                óP   <€ \         SV `  4       R ,           V P                  ,           # ©r,   )r@   r/   rŠ   ©r   rD   s   &€r   r/   ÚDateAttribute.__str__[  s    ø€ Ü‰w‰Ó  3Õ&¨×)9Ñ)9Õ9Ð9r   )rŠ   r‹   r   r   r-   )r	   r
   r   r   r   r`   r¡   r1   r#   r)   r/   r   r2   ra   rb   s   @@r   r‡   r‡     sB   ù‡ € õ:ð ñ$:ó ð$:ðL ñó ðò"
5÷:õ :r   r‡   c                   óT   a a€ ] tR tRt oV 3R lt]R 4       tR tV 3R ltRt	Vt
V ;t# )ÚRelationalAttributei_  c                óz   <€ \         SV `  V4       R V n        \        P                  V n        . V n        RV n        R# )Ú
relationalN)r@   r   r-   r   r   r   Ú
attributesÚdialectrh   s   &&€r   r   ÚRelationalAttribute.__init__a  s0   ø€ Ü‰Ñ˜ÔØ%ˆŒÜ—Z‘ZˆŒ
ØˆŒØˆŽr   c                óx   € VP                  4       P                  4       pVR\        R4       R8X  d	   V ! V4      # R# )r¤   Nr¹   rm   )r!   r   r"   r¥   s   &&& r   r#   Ú#RelationalAttribute.parse_attributeh  s>   € ð (×-Ñ-Ó/×5Ñ5Ó7ÐàÐ/œc ,Ó/Ð0°LÔ@Ù�t“9Ðár   c                ó8  € \        \        \        V P                  4      4      4      pVP	                  4       P                  R 4      p. pVP                  R4       Fn  p\        WPP                  4      w  q`n        TP                  \        V Uu. uF*  qpP                  V,          P                  Wg,          4      NK,  	  up4      4       Kp  	  \        P                  ! TV P                   Uu. uF  qˆP                  VP                  3NK  	  up4      # u upi u upi )zunicode-escapeÚ
)Úlistr   r:   rº   ÚencodeÚdecodeÚsplitrI   r»   ÚappendrK   r)   r   Úarrayr   r   )	r   r(   ÚelemsÚescaped_stringÚ
row_tuplesÚrawÚrowr<   Úas	   &&       r   r)   ÚRelationalAttribute.parse_datay  sà   € ä”Uœ3˜tŸ™Ó/Ó0Ó1ˆà!Ÿ™Ó*×1Ñ1Ð2BÓCˆàˆ
à!×'Ñ'¨Ö-ˆCÜ /°·\±\Ó BÑˆC”à×ÑœeÙ@EÓFÁ¸1—‘ Õ#×.Ñ.¨s­vÖ6ÁÑFóHö Iñ .ô �xŠx˜
Ø48·O²OÓD±O¨qŸ&™& !§'¡'Ó*±OÑDóFð 	Fùò Gùò Es   Â0DÃ+ D
c                ó|   <€ \         SV `  4       R ,           R P                  R V P                   4       4      ,           # )z
	c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir   )rX   )r;   rÌ   s   & r   r=   Ú.RelationalAttribute.__str__.<locals>.<genexpr>Œ  s   é € Ð<©O qœC ŸF˜F«Oùr?   )r@   r/   Újoinrº   r´   s   &€r   r/   ÚRelationalAttribute.__str__Š  s2   ø€ Ü‘‘Ó! FÕ*Ø—‘Ñ<¨D¯OªOÓ<Ó<õ=ð 	>r   )rº   r»   r   r-   )r	   r
   r   r   r   r1   r#   r)   r/   r   r2   ra   rb   s   @@r   r·   r·   _  s.   ù‡ € õð ñó ðò F÷">õ >r   r·   c                 ó˜   € \         \        \        \        \        3pV F  pVP                  W4      pVf   K  Vu # 	  \        RV 24      h)Nzunknown attribute )r6   rd   r‡   r€   r·   r#   r   )r   r"   Úattr_classesr!   Úattrs   &&   r   Úto_attributerÖ   ’  sS   € Ü$Ô&6¼Ü#Ô%8ð:€Ló ˆØ×"Ñ" 4Ó5ˆØÔØŠKñ ô
 Ð-¨k¨]Ð;Ó
<Ð<r   c                 óÈ   € \        \        RR4      p V fM   \        P                  ! 4       P	                  R4      pVP
                  R8g  \        n        \        P                  p V # )zD
Checks if the bug https://bugs.python.org/issue30157 is unpatched.
Úhas_bugNz3, 'a'r¨   )ÚgetattrÚcsv_sniffer_has_bug_last_fieldÚcsvÚSnifferÚsniffÚ	quotecharrØ   )rØ   r»   s     r   rÚ   rÚ   ž  sR   € ô Ô4°iÀÓF€Gà‚Ü—+’+“-×%Ñ% hÓ/ˆØ18×1BÑ1BÀcÑ1IÔ&Ô.Ü0×8Ñ8ˆà€Nr   c                ó|  € \        4       '       Ed«   RpRRVR3 FX  p\        P                  ! V\        P                  \        P                  ,          4      pVP                  V 4      pV'       g   KX   M	  XV8w  d   R# XP                  p\        X4      ^8X  g   Q hV^ ,          pVR,          ^,
          p	W‰,          p
VR,          ^,
          p	W‰,          pVR,          ^,
          p	\        W‰,          4      p\        P                  ! R	\        P                  ! V4       R
V
 R\        P                  ! V4       RV
 R\        P                  ! V4       RV
 R\        P                  ! V4       R2\        P                  4      p\        VP                  V 4      4      pW¡n        W²9   d   W±n        Wán        WÁn        R# R# )zL
Workaround for the bug https://bugs.python.org/issue30157 if is unpatched.
zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n)NÚquoteÚdelimÚspacez((z)|^)\W*z[^z\n]*z\W*((z)|$))rÚ   ÚreÚcompileÚDOTALLÚ	MULTILINEÚfindallÚ
groupindexr:   ÚboolÚescapeÚsearchrÞ   Ú	delimiterÚdoublequoteÚskipinitialspace)Ú
sniff_liner»   Ú
delimitersÚright_regexÚrestrÚregexpÚmatchesrè   rN   Únrà   rá   râ   Ú	dq_regexprí   s   &&&            r   Ú%workaround_csv_sniffer_bug_last_fieldr÷   ®  s³  € ô &×'Ó'à`ˆàbØ`Ø!ØFóHˆEô —Z’Z ¤r§y¡y´2·<±<Õ'?Ó@ˆFØ—n‘n ZÓ0ˆGß‰wÙñHð �KÔÙà×&Ñ&ˆ
ô �7‹|˜qÔ Ð Ð Ø�A�Jˆà�wÕ !Õ#ˆØ•ˆà�wÕ !Õ#ˆØ•ˆà�wÕ !Õ#ˆÜ�Q•T“
ˆä—J’JØ”"—)’)˜EÓ"Ð# 7¨5¨'°´B·I²I¸eÓ4DÐ3EÀTÈ%ÈÐPRÔSU×S\ÒS\Ð]bÓScÐRdÐdhÐinÐhoÐotÔuw×u~Òu~ð  @Eó  vFð  uGð  GKð  Lô  NP÷  NZñ  NZó
ˆ	ô ˜9×+Ñ+¨JÓ7Ó8ˆà!ÔØÔØ %ÔØ)ÔØ#(Ö ñW (r   c                 ó"  a € R p\         P                  ! \        \        P                  ! R	4      P
                  ^,          4      4       S R	,          R8X  d   S RR	 o S P                  4       o S p\        ;QJ d    V 3R lV 4       F  '       g   K   RM	  RM! V 3R lV 4       4      '       g
   VR,          pVf4   \         P                  ! 4       P                  W2R7      p\        VVVR7       \        \         P                  ! S .V4      4      pWA3# )
z,	rÀ   Nc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir   r   )r;   ÚdÚlines   & €r   r=   Ú"split_data_line.<locals>.<genexpr>ò  s   øé € Ð-¡*˜Q�DŽy£*ùs   ƒTFr,   )rð   )rï   r»   rð   r\   )rÛ   Úfield_size_limitrk   ÚctypesÚc_ulongÚvaluero   ÚanyrÜ   rÝ   r÷   ÚnextÚreader)rû   r»   rð   rï   rË   s   f&   r   rI   rI   à  sÙ   ø€ Ø€Jô ×ÒœœVŸ^š^¨BÓ/×5Ñ5¸Õ:Ó;Ô<ð ˆB…x�4ÔØ�C�Rˆyˆð �:‰:‹<€Dà€J÷ ‹3Ô-¡*Ó-�3�3Š3Ô-¡*Ó-×-Ò-Ø�cÕˆ
à‚Ü—+’+“-×%Ñ% jÐ%ÓHˆÜ-¸Ø6=Ø9Cõ	Eô Œs�zŠz˜4˜& 'Ó*Ó
+€Càˆ<Ðr   c                óÞ  € VP                  4       p\        P                  V4      pV'       d…   VP                  ^4      p\        P                  V4      '       d   \        V4      w  rV\        V 4      pMM\        P                  V4      '       d   \        V4      w  rV\        V 4      pM\        R4      h\        RV 24      h\        WV4      pVP                  4       R8X  d   \        WV4      pW3# )a.  Parse a raw string in header (e.g., starts by @attribute).

Given a raw string attribute, try to get the name and type of the
attribute. Constraints:

* The first line must start with @attribute (case insensitive, and
  space like characters before @attribute are allowed)
* Works also if the attribute is spread on multilines.
* Works if empty lines or comments are in between

Parameters
----------
attribute : str
   the attribute string.

Returns
-------
name : str
   name of the attribute
value : str
   value of the attribute
next : str
   next line to be parsed

Examples
--------
If attribute is a string defined in python as r"floupi real", will
return floupi as name, and real as value.

>>> from scipy.io.arff._arffread import tokenize_attribute
>>> iterable = iter([0] * 10) # dummy iterator
>>> tokenize_attribute(iterable, r"@attribute floupi real")
('floupi', 'real', 0)

If attribute is r"'floupi 2' real", will return 'floupi 2' as name,
and real as value.

>>> tokenize_attribute(iterable, r"  @attribute 'floupi 2' real   ")
('floupi 2', 'real', 0)

zmulti line not supported yetzFirst line unparsable: r¹   )ro   Úr_attributerH   rJ   Úr_comattrvalÚtokenize_single_commar  Úr_wcomattrvalÚtokenize_single_wcommarL   rÖ   rn   Úread_relational_attribute)ÚiterableÚ	attributeÚsattrÚmattrrM   r   ÚtypeÚ	next_items   &&      r   Útokenize_attributer    sÍ   € ðT �O‰OÓ€EÜ×Ñ˜eÓ$€Eßà�{‰{˜1‹~ˆÜ×Ñ˜d×#Ò#Ü.¨tÓ4‰JˆDÜ˜X›‰IÜ× Ñ  ×&Ò&Ü/°Ó5‰JˆDÜ˜X›‰Iô Ð;Ó<Ð<äÐ2°5°'Ð:Ó;Ð;ä˜TÓ(€Ià‡z�zƒ|�|Ô#Ü-¨hÀ9ÓMˆ	ð ÐÐr   c                 ó  € \         P                  V 4      pV'       dC    VP                  ^4      P                  4       pVP                  ^4      P                  4       pW#3# \        RV  24      h  \         d   p\        R4      ThRp?ii ; i©r�   z Error while tokenizing attributeNzError while tokenizing single )r  rH   rJ   ro   Ú
IndexErrorrL   ©ÚvalrN   r   r  Úes   &    r   r  r  H  sŠ   € ô 	×Ñ˜3Ó€Aßð	HØ—7‘7˜1“:×#Ñ#Ó%ˆDØ—7‘7˜1“:×#Ñ#Ó%ˆDð
 ˆ:Ðô Ð9¸#¸Ð?Ó@Ð@øô ô 	HÜÐ?Ó@ÀaÐGûð	Húó   Ÿ>A. Á.B
Á9BÂB
c                 ó  € \         P                  V 4      pV'       dC    VP                  ^4      P                  4       pVP                  ^4      P                  4       pW#3# \        RV  24      h  \         d   p\        R4      ThRp?ii ; ir  )r  rH   rJ   ro   r  rL   r  s   &    r   r	  r	  W  sŠ   € ô 	×Ñ˜CÓ €Aßð	HØ—7‘7˜1“:×#Ñ#Ó%ˆDØ—7‘7˜1“:×#Ñ#Ó%ˆDð
 ˆ:Ðô Ð9¸#¸Ð?Ó@Ð@øô ô 	HÜÐ?Ó@ÀaÐGûð	Húr  c                ó¤  € \         P                  ! RVP                  ,           R,           4      pVP                  V4      '       g€   \        P                  V4      pV'       dV   \
        P                  V4      pV'       d+   \        W4      w  rbVP                  P                  V4       K{  \        RV 24      h\        V 4      pK–  \        V 4      pV# )z4Read the nested attributes of a relational attributez^@[Ee][Nn][Dd]\s*z\s*$úError parsing line )rã   rä   r   rH   Úr_headerliner  r  rº   rÅ   rL   r  )ÚofileÚrelational_attributer<   Úr_end_relationalrN   ÚisattrrÕ   s   &&&    r   r
  r
  f  s±   € ô —z’zÐ"6Ø"6×";Ñ";õ#<Ø>Eõ#Fó GÐð ×$Ñ$ Q×'Ò'Ü×Ñ˜qÓ!ˆßÜ ×&Ñ& qÓ)ˆFßÜ,¨UÓ6‘�Ø$×/Ñ/×6Ñ6°tÖ<ä Ð#6°q°cÐ!:Ó;Ð;ä�U“ŠAäˆU‹€AØ€Hr   c                ó  € \        V 4      p\        P                  V4      '       d   \        V 4      pK(  Rp. p\        P                  V4      '       g²   \        P                  V4      pV'       dˆ   \
        P                  V4      pV'       d!   \        W4      w  raVP                  V4       Ku  \        P                  V4      pV'       d   VP                  ^4      pM\        RV 24      h\        V 4      pK¿  \        V 4      pKÌ  W#3# )z&Read the header of the iterable ofile.Nr  )r  Ú	r_commentrH   Ú
r_datametar  r  r  rÅ   Ú
r_relationrJ   rL   )r  r<   Úrelationrº   rN   r   rÕ   Úisrels   &       r   Úread_headerr'  |  sÐ   € äˆU‹€Aô �/‰/˜!×
Ò
Ü�‹KŠð €HØ€JÜ×Ñ˜q×!Ò!Ü×Ñ˜qÓ!ˆßÜ ×&Ñ& qÓ)ˆFßÜ,¨UÓ6‘�Ø×!Ñ! $Ö'ä"×(Ñ(¨Ó+�ßØ$Ÿ{™{¨1›~‘Hä$Ð':¸1¸#Ð%>Ó?Ð?Ü˜“K’ä�U“ŠAàÐÐr   c                   óH   a € ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )r   i›  aO  Small container to keep useful information on a ARFF dataset.

Knows about attributes names and types.

Examples
--------
::

    data, meta = loadarff('iris.arff')
    # This will print the attributes names of the iris.arff dataset
    for i in meta:
        print(i)
    # This works too
    meta.names()
    # Getting attribute type
    types = meta.types()

Methods
-------
names
types

Notes
-----
Also maintains the list of attributes in order, i.e., doing for i in
meta, where meta is an instance of MetaData, will return the
different attribute names in the order they were defined.
c                ó^   € Wn         V Uu/ uF  q3P                   VbK  	  upV n        R # u upi r   )r   Ú_attributes)r   ÚrelrÕ   rÌ   s   &&& r   r   ÚMetaData.__init__¸  s'   € ØŒ	Ù/3Ó4©t¨!ŸF™F AšI©tÑ4ˆÖùÒ4s   ‹*c                ój  € R pVRV P                    R2,          pV P                   F‰  pVRV RV P                  V,          P                   2,          pV P                  V,          P                  '       d1   VR\	        V P                  V,          P                  4       2,          pVR,          pK‹  	  V# )Ú z	Dataset: rÀ   Ú	z's type is z, range is )r   r*  r-   r   rX   r]   s   &  r   Ú__repr__ÚMetaData.__repr__¼  s¦   € ØˆØ�˜4Ÿ9™9˜+ RÐ(Õ(ˆØ×!Ô!ˆAØ�R˜�s˜+ d×&6Ñ&6°qÕ&9×&CÑ&CÐ%DÐEÕEˆCØ×Ñ Õ"×(×(Ð(Ø˜¤S¨×)9Ñ)9¸!Õ)<×)BÑ)BÓ%CÐ$DÐEÕE�Ø�4�KŠCñ	 "ð
 ˆ
r   c                ó,   € \        V P                  4      # r   )Úiterr*  r.   s   &r   Ú__iter__ÚMetaData.__iter__Æ  s   € Ü�D×$Ñ$Ó%Ð%r   c                óX   € V P                   V,          pVP                  VP                  3# r   )r*  r-   r   )r   ÚkeyrÕ   s   && r   Ú__getitem__ÚMetaData.__getitem__É  s%   € Ø×Ñ Õ$ˆà—‘ §
¡
Ð+Ð+r   c                ó,   € \        V P                  4      # )zfReturn the list of attribute names.

Returns
-------
attrnames : list of str
    The attribute names.
)rÁ   r*  r.   s   &r   ÚnamesÚMetaData.namesÎ  s   € ô �D×$Ñ$Ó%Ð%r   c                ó|   € V P                    Uu. uF   pV P                   V,          P                  NK"  	  ppV# u upi )zgReturn the list of attribute types.

Returns
-------
attr_types : list of str
    The attribute types.
)r*  r-   )r   r   Ú
attr_typess   &  r   ÚtypesÚMetaData.typesØ  sF   € ð #'×"2Ò"2ó4Ù"2˜$ð ×&Ñ& tÕ,×6Ô6Ù"2ð 	ð 4àÐùò4s   �&9)r*  r   N)r	   r
   r   r   r   r   r0  r4  r8  r;  r?  r   r2   r3   s   @r   r   r   ›  s-   ø‡ € ñò85òò&ò,ò
&÷
ð 
r   c                ó¼   € \        V R4      '       d   T pM\        V 4      p \        V4      WJd   VP                  4        # #   YJd   TP                  4        i i ; i)a@  
Read an arff file.

The data is returned as a record array, which can be accessed much like
a dictionary of NumPy arrays. For example, if one of the attributes is
called 'pressure', then its first 10 data points can be accessed from the
``data`` record array like so: ``data['pressure'][0:10]``


Parameters
----------
f : file-like or str
   File-like object to read from, or filename to open.

Returns
-------
data : record array
   The data of the arff file, accessible by attribute names.
meta : `MetaData`
   Contains information about the arff file such as name and
   type of attributes, the relation (name of the dataset), etc.

Raises
------
ParseArffError
    This is raised if the given file is not ARFF-formatted.
NotImplementedError
    The ARFF file has an attribute which is not supported yet.

Notes
-----

This function should be able to read most arff files. Not
implemented functionality include:

* date type attributes
* string type attributes

It can read files with numeric and nominal attributes. It cannot read
files with sparse data ({} in the file). However, this function can
read files with missing data (? in the file), representing the data
points as NaNs.

Examples
--------
>>> from scipy.io import arff
>>> from io import StringIO
>>> content = """
... @relation foo
... @attribute width  numeric
... @attribute height numeric
... @attribute color  {red,green,blue,yellow,black}
... @data
... 5.0,3.25,blue
... 4.5,3.75,green
... 3.0,4.00,red
... """
>>> f = StringIO(content)
>>> data, meta = arff.loadarff(f)
>>> data
array([(5.0, 3.25, 'blue'), (4.5, 3.75, 'green'), (3.0, 4.0, 'red')],
      dtype=[('width', '<f8'), ('height', '<f8'), ('color', '|S6')])
>>> meta
Dataset: foo
    width's type is numeric
    height's type is numeric
    color's type is nominal, range is ('red', 'green', 'blue', 'yellow', 'black')

Úread)ÚhasattrÚopenÚ	_loadarffÚclose)Úfr  s   & r   ÚloadarffrH  å  sT   € ôL ˆq�&×ÒØ‰ä�Q“ˆðÜ˜Óà‹>Ø�K‰K�Mð øˆ5‹>Ø�K‰K�Mð ús   ¢
A ÁAc                 óà  a	a
€  \        V 4      w  po	RpS	 F  p\	        T\
        4      '       g   K  RpK  	  \        TS	4      pT'       d   \        R4      h\        S	4      o
RT	T
3R llp\        T! T 4      4      p\        P                  ! TS	 Uu. uF  qUP                  TP                  3NK  	  up4      pY†3#   \         d$   pR \        T4      ,           p\        T4      ThRp?ii ; iu upi )z'Error while parsing header, error was: NFTz*String attributes not supported yet, sorryc           
   3   óT  <"  € \        \        S4      4      pR pV  F�  p\        P                  V4      '       g   \        P                  V4      '       d   K;  \        WC4      w  rS\        V Uu. uF!  pSV,          P                  WV,          4      NK#  	  up4      x € Kƒ  	  R # u upi 5ir   )rÁ   r   r"  rH   Úr_emptyrI   rK   r)   )	Úrow_iterrá   rÇ   r»   rÊ   rË   r<   rÕ   Únis	   &&     €€r   Ú	generatorÚ_loadarff.<locals>.generatorU  sƒ   øé € ô ”U˜2“Y“ˆàˆÛˆCô �‰˜s×#Ò#¤w§}¡}°S×'9Ò'9Ùä*¨3Ó8‰LˆCä¹UÓC¹U¸˜˜a�×+Ñ+¨C­FÖ3¹UÑCÓDÔDó ùò Dùs   ƒAB(ÁB(Á-'B#
ÂB(r³   )r'  rL   rX   r   Ú
isinstancer€   r   ÚNotImplementedErrorr:   rÁ   r   rÆ   r   r   )r  r+  r  r^   ÚhasstrrÌ   ÚmetarN  r{   rÕ   rM  s   &        @@r   rE  rE  6  så   ù€ ð)Ü Ó&‰	ˆˆTð €FÛˆÜ�aœ×)Ô)ØŠFñ ô �C˜Ó€D÷ ô "Ð"NÓOÐOä	ˆT‹€B÷Eð Eô8 	‰Y�uÓÓ€Aä�8Š8�A±4Ó8±4¨aŸ™ §¡Ó)±4Ñ8Ó9€DØˆ:Ðøôu ô )Ø7¼#¸a»&Õ@ˆÜ˜SÓ! qÐ(ûð)üòr 9s   „B: Â C+
Â:C(ÃC#Ã#C()r   rH  r   r   r   )(rã   r¬   Únumpyr   rÛ   rþ   Ú__all__rä   Úr_metar"  rK  r  r#  r$  r  rG   rž   r  r  ÚOSErrorr   r   r   r6   rd   r€   r‡   r·   rÖ   rÚ   r÷   rI   r  r  r	  r
  r'  r   rH  rE  r   r   r   Ú<module>rX     sp  ðã 	Û ã ã 
Û à "â
A€ð$ 
�Š�HÓ	€à�JŠJ�uÓ€	à
�*Š*�XÓ
€à�zŠz˜+Ó&€Ø�ZŠZÐ-Ó.€
Ø�ZŠZÐEÓF€
Ø�jŠjÐNÓO€à�JŠJ�yÓ!€	Ø	�ŠÐ<Ó	=€ð �zŠzÐ-Ó.€à—
’
Ð,Ó-€ô	�ô 	ô	�Yô 	÷0ñ 0ô<H�yô HôV;5�yô ;5ô|�iô ô0P:�Iô P:ôf->˜)ô ->òf	=òò /)ôdòFB òJòòò, ÷>Gñ GòTNôb>r   