
    5[gg                     *   d dl Z d dlZd dlZd dlZd dlZ	 g dZ e j                  d      Z e j                  d      Z	 e j                  d      Z
 e j                  d      Z e j                  d      Z e j                  d      Z e j                  d	      Z e j                  d
      Z e j                  d      Z e j                  d      Z e j                  d      Z G d de      Z G d de      Z G d d      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zd Zd Zd  Zd1d!Zd" Z d# Z!d$ Z"d% Z#d& Z$ G d' d(      Z%d) Z&d* Z'd+ Z(d, Z)d- Z*d.e*_+        e,d/k(  rd dl-Z-e-j\                  d0   Z/ e*e/       yy)2    N)MetaDataloadarff	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                       e Zd Zy)r   N__name__
__module____qualname__     R/var/www/html/bid-api/venv/lib/python3.12/site-packages/scipy/io/arff/_arffread.pyr   r   6       r   r   c                       e Zd Zy)r   Nr   r   r   r   r   r   :   r   r   r   c                   2    e Zd ZdZd Zed        Zd Zd Zy)	AttributeNc                 J    || _         d | _        t        j                  | _        y N)namerangenpobject_dtype)selfr   s     r   __init__zAttribute.__init__E   s    	
ZZ
r   c                      y)zj
        Parse the attribute line if it knows how. Returns the parsed
        attribute, or None.
        Nr   clsr   attr_strings      r   parse_attributezAttribute.parse_attributeJ   s     r   c                      y)-
        Parse a value of this type.
        Nr   r   data_strs     r   
parse_datazAttribute.parse_dataR   s     r   c                 :    | j                   dz   | j                  z   S )r"   ,)r   	type_namer   s    r   __str__zAttribute.__str__X   s     yy3//r   )	r	   r
   r   r(   r   classmethodr    r%   r*   r   r   r   r   r   A   s*    I 
  0r   r   c                   N     e Zd ZdZ fdZed        Zed        Zd Z	d Z
 xZS )NominalAttributenominalc                     t         |   |       || _        || _        t        j
                  t        d |D              f| _        y )Nc              3   2   K   | ]  }t        |        y wr   )len).0is     r   	<genexpr>z,NominalAttribute.__init__.<locals>.<genexpr>g   s     $<VSVV   )superr   valuesr   r   bytes_maxr   )r   r   r7   	__class__s      r   r   zNominalAttribute.__init__c   s9    
ii$<V$<!<=
r   c                     t         j                  |       }|r(t        |j                  d            \  }}t	        |      S t        d      )a8  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_valzNominalAttribute._get_nom_vali   sA    . OOD!&qwwqz2HE1<GHHr   c                 H    |d   dk(  r| j                  |      } | ||      S y)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>}'.
        r   {N)rG   )r   r   r   r7   s       r   r    z NominalAttribute.parse_attribute   s0     q>S %%k2FtV$$r   c                     || j                   v r|S |dk(  r|S t        t        |       dt        | j                                )r"   ?z value not in )r7   rB   strr#   s     r   r%   zNominalAttribute.parse_data   sE     t{{"O_OHnS=M<NOPPr   c                     | j                   dz   }t        t        | j                        dz
        D ]  }|| j                  |   dz   z  } || j                  d   z  }|dz  }|S )Nz,{r<   r'   })r   r   r1   r7   r   msgr3   s      r   r*   zNominalAttribute.__str__   sd    ii$s4;;')*A4;;q>C''C +t{{2s

r   )r	   r
   r   r(   r   staticmethodrG   r+   r    r%   r*   __classcell__r:   s   @r   r-   r-   _   sB    I> I I:  	Qr   r-   c                   :     e Zd Z fdZed        Zd Zd Z xZS )NumericAttributec                 \    t         |   |       d| _        t        j                  | _        y )Nnumeric)r6   r   r(   r   float64r   r   r   r:   s     r   r   zNumericAttribute.__init__   s"    "ZZ
r   c                     |j                         j                         }|dt        d       dk(  s"|dt        d       dk(  s|dt        d       dk(  r | |      S y)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'.
        NrX   intreallowerstripr1   r   s      r   r    z NumericAttribute.parse_attribute   sa     "'')//1Y(I5{E
#u,|F$.t9r   c                 @    d|v rt         j                  S t        |      S )a  
        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
        rK   )r   nanfloatr#   s     r   r%   zNumericAttribute.parse_data   s    2 (?66M?"r   c                     |j                   dz  |j                   dz
  z  }t        j                  |      t        j                  |      t        j                  |      t        j
                  |      |z  fS Ng      ?r<   sizer   nanminnanmaxmeanstd)r   datanbfacs      r   _basic_statszNumericAttribute._basic_stats   sU    		B$))a-0		$4rvvd|e35 	5r   )	r	   r
   r   r   r+   r    r%   rn   rS   rT   s   @r   rV   rV      s&     
  $#<5r   rV   c                   .     e Zd Z fdZed        Z xZS )StringAttributec                 2    t         |   |       d| _        y )Nstring)r6   r   r(   rZ   s     r   r   zStringAttribute.__init__   s    !r   c                 r    |j                         j                         }|dt        d       dk(  r | |      S y)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'.
        Nrr   r^   r   s      r   r    zStringAttribute.parse_attribute   s;     "'')//1~H&(2t9r   )r	   r
   r   r   r+   r    rS   rT   s   @r   rp   rp      s    "  r   rp   c                   N     e Zd Z fdZed        Zed        Zd Z fdZ	 xZ
S )DateAttributec                     t         |   |       || _        || _        d| _        || _        t        j                  d| j                        | _        y )Ndater   )	r6   r   date_formatdatetime_unitr(   r   r   
datetime64r   )r   r   rx   ry   r:   s       r   r   zDateAttribute.__init__  sF    &* 
]]1d&8&89
r   c                    t         j                  |       }|r|j                  d      j                         }d }d|v r|j	                  dd      }d}n	 |j	                  dd      }d}d|v r|j	                  dd      }d	}d
|v r|j	                  d
d      }d}d|v r|j	                  dd      }d}d|v r|j	                  dd      }d}d|v r|j	                  dd      }d}d|v sd|v rt        d      |t        d      ||fS t        d      )Nr<   yyyyz%YYyyz%yMMz%mMddz%dDHHz%Hhmmz%MrD   ssz%SszZz6Date type attributes with time zone not supported, yetz"Invalid or unsupported date formatzInvalid or no date format)r_dater>   r@   r`   replacerB   )rC   rD   patternry   s       r   _get_date_formatzDateAttribute._get_date_format
  s9   LLggaj&&(G M !//&$7 #!//$5 #w!//$5 #w!//$5 #w!//$5 #w!//$5 #w!//$5 #g~  "2 3 3 $ !EFFM))899r   c                     |j                         j                         }|dt        d       dk(  r| j                  |      \  }} | |||      S y)
        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>'.
        Nrw   )r_   r`   r1   r   )r   r   r   attr_string_lowerrx   ry   s         r   r    zDateAttribute.parse_attribute1  sV     (--/557\c&k*f4),)=)=k)J&Kt[-88r   c                 ^   |j                         j                  d      j                  d      }|dk(  r t        j                  d| j                        S t        j                  j                  || j                        }t        j                  |      j                  d| j                  z        S )r"   '"rK   NaTzdatetime64[%s])r`   r   rz   ry   datetimestrptimerx   astype)r   r$   date_strdts       r   r%   zDateAttribute.parse_dataC  s     >>#))#.44S9s?==(:(:;;""++Hd6F6FGB==$++ 4#5#557 7r   c                 @    t         |          dz   | j                  z   S )Nr'   )r6   r*   rx   r   r:   s    r   r*   zDateAttribute.__str__O  s     w 3&)9)999r   )r	   r
   r   r   rR   r   r+   r    r%   r*   rS   rT   s   @r   ru   ru      s@    : $: $:L  "
7: :r   ru   c                   >     e Zd Z fdZed        Zd Z fdZ xZS )RelationalAttributec                 x    t         |   |       d| _        t        j                  | _        g | _        d | _        y )N
relational)r6   r   r(   r   r   r   
attributesdialectrZ   s     r   r   zRelationalAttribute.__init__U  s0    %ZZ
r   c                 r    |j                         j                         }|dt        d       dk(  r | |      S y)r   Nr   r^   )r   r   r   r   s       r   r    z#RelationalAttribute.parse_attribute\  s>     (--/557/c,/0L@t9r   c                 $   t        t        t        | j                                    }|j	                         j                  d      }g }|j                  d      D ]g  }t        || j                        \  }| _        |j                  t        |D cg c]#  }| j                  |   j                  ||         % c}             i t        j                  || j                  D cg c]  }|j                  |j                  f c}      S c c}w c c}w )Nzunicode-escape
)listr   r1   r   encodedecodesplitr?   r   appendrA   r%   r   arrayr   r   )	r   r$   elemsescaped_string
row_tuplesrawrowr3   as	            r   r%   zRelationalAttribute.parse_datam  s    U3t/01!*112BC
!''-C /T\\ BCe@EF1#..s1v6FH I . xx
48OODOq!&&!''*ODF 	F G Es   (D"D
c                 l    t         |          dz   dj                  d | j                  D              z   S )Nz
	c              3   2   K   | ]  }t        |        y wr   )rL   )r2   r   s     r   r4   z.RelationalAttribute.__str__.<locals>.<genexpr>  s     <OqCFOr5   )r6   r*   joinr   r   s    r   r*   zRelationalAttribute.__str__~  s2    !F*<DOO<<= 	>r   )	r	   r
   r   r   r+   r    r%   r*   rS   rT   s   @r   r   r   S  s,       F"> >r   r   c                     t         t        t        t        t        f}|D ]  }|j                  | |      }||c S  t        d|z        )Nzunknown attribute %s)r-   rV   ru   rp   r   r    r   )r   r   attr_classesr   attrs        r   to_attributer     sS    $&6#%8:L ""45K 
 /+=
>>r   c                      t        t        dd      } | Kt        j                         j	                  d      }|j
                  dk7  t        _        t        j                  } | S )zL
    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     4iFG++-%%h/181B1Bc1I&.088Nr   c                    t               rod}dd|dfD ]L  }t        j                  |t        j                  t        j                  z        }|j                  |       }|sL n |k7  ryj                  }t              dk(  sJ |d   }|d   dz
  }	||	   }
|d	   dz
  }	||	   }|d
   dz
  }	t        ||	         }t        j                  dt        j                  |       d|
 dt        j                  |       d|
 dt        j                  |       d|
 dt        j                  |       dt        j                        }t        |j                  |             }|
|_        ||v r||_        ||_        ||_        yy)zT
    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)Nr<   r   quotedelimspacez((z)|^)\W*z[^z\n]*z\W*((z)|$))r   recompileDOTALL	MULTILINEfindall
groupindexr1   boolescapesearchr   	delimiterdoublequoteskipinitialspace)
sniff_liner   
delimitersright_regexrestrregexpmatchesr   rD   nr   r   r   	dq_regexpr   s                  r   %workaround_csv_sniffer_bug_last_fieldr     s    &'`b`!FHE ZZryy2<<'?@FnnZ0GH K&&
 7|q   AJw!#!w!#!w!#QqT
JJ"))E"#75'BIIe4D3ET%PRSUS\S\]bScRddhinhootuwu~u~  @E  vF  uG  GK  L  NP  NZ  NZ
	 9++J78!J %G)#( W (r   c                     d}t        j                  t        t        j                  d      j
                  dz                d   dk(  r d d   j                           }t         fd|D              s|dz  }|3t        j                         j                  ||      }t        |||       t        t        j                   g|            }||fS )	Nz,	rN      r   c              3   &   K   | ]  }|v  
 y wr   r   )r2   dlines     r   r4   z"split_data_line.<locals>.<genexpr>  s     -*QqDy*s   r'   )r   )r   r   r   )r   field_size_limitr\   ctypesc_ulongvaluer`   anyr   r   r   nextreader)r   r   r   r   r   s   `    r   r?   r?     s    J V^^B/55:;< Bx4CRy ::<DJ -*--c
++-%%jZ%H-6=9C	E szz4&'*
+C<r   c                    |j                         }t        j                  |      }|rz|j                  d      }t        j                  |      rt        |      \  }}t        |       }nHt        j                  |      rt        |      \  }}t        |       }nt        d      t        d|z        t        ||      }|j                         dk(  rt        | ||      }||fS )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)

    r<   zmulti line not supported yetzFirst line unparsable: %sr   )r`   r_attributer>   r@   r_comattrvaltokenize_single_commar   r_wcomattrvaltokenize_single_wcommarB   r   r_   read_relational_attribute)iterable	attributesattrmattrrC   r   type	next_items           r   tokenize_attributer     s    T OOEe$E{{1~d#.t4JD$XI  &/5JD$XI ;<<4u<==T4(Izz||#-h	9M	 ir   c                    t         j                  |       }|rC	 |j                  d      j                         }|j                  d      j                         }||fS t        d| z        # t        $ r}t        d      |d }~ww xY wNr<   r   z Error while tokenizing attributez Error while tokenizing single %s)r   r>   r@   r`   
IndexErrorrB   valrD   r   r   es        r   r   r   <  s     	3A	H771:##%D771:##%D
 : ;cABB  	H?@aG	H   >A) )	B2A>>Bc                    t         j                  |       }|rC	 |j                  d      j                         }|j                  d      j                         }||fS t        d| z        # t        $ r}t        d      |d }~ww xY wr   )r   r>   r@   r`   r   rB   r   s        r   r   r   K  s     	C A	H771:##%D771:##%D
 : ;cABB  	H?@aG	Hr   c                    t        j                  d|j                  z   dz         }|j                  |      st        j                  |      }|rPt
        j                  |      }|r+t        | |      \  }}|j                  j                  |       nt        d|z        t        |       }|j                  |      st        |       }|S )z4Read the nested attributes of a relational attributez^@[Ee][Nn][Dd]\s*z\s*$Error parsing line %s)r   r   r   r>   r_headerliner   r   r   r   rB   r   )ofilerelational_attributer3   r_end_relationalrD   isattrr   s          r   r   r   Z  s     zz"6"6";";#<>E#F G $$Q'q! &&q)F,UA6a$//66t< !81!<==UA $$Q' 	UAHr   c                 $   t        |       }t        j                  |      r!t        |       }t        j                  |      r!d}g }t        j                  |      st        j                  |      }|r{t
        j                  |      }|r!t        | |      \  }}|j                  |       nNt        j                  |      }|r|j                  d      }nt        d|z        t        |       }nt        |       }t        j                  |      s||fS )z&Read the header of the iterable ofile.Nr<   r   )r   	r_commentr>   
r_datametar   r   r   r   
r_relationr@   rB   )r   r3   relationr   rD   r  r   isrels           r   read_headerr  p  s    UA //!
K //!
 HJq!q! &&q)F,UA6a!!$'"((+${{1~H$%<q%@AAKUA q!" Zr   c                   4    e Zd ZdZd Zd Zd Zd Zd Zd Z	y)	r   a  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                 \    || _         |D ci c]  }|j                   | c}| _        y c c}w r   )r   _attributes)r   relr   r   s       r   r   zMetaData.__init__  s+    	/34t!AFFAIt44s   )c                     d}|d| j                   z  z  }| j                  D ]j  }|d| d| j                  |   j                   z  }| j                  |   j                  r(|dt	        | j                  |   j                        z  z  }|dz  }l |S )N zDataset: %s
	z's type is z, range is %sr   )r   r  r(   r   rL   rP   s      r   __repr__zMetaData.__repr__  s    **!!ARs+d&6&6q&9&C&C%DEEC"((T-=-=a-@-F-F)GGG4KC	 "
 
r   c                 ,    t        | j                        S r   )iterr  r)   s    r   __iter__zMetaData.__iter__  s    D$$%%r   c                 P    | j                   |   }|j                  |j                  fS r   )r  r(   r   )r   keyr   s      r   __getitem__zMetaData.__getitem__  s%    $

++r   c                 ,    t        | j                        S )zReturn the list of attribute names.

        Returns
        -------
        attrnames : list of str
            The attribute names.
        )r   r  r)   s    r   nameszMetaData.names  s     D$$%%r   c                 p    | j                   D cg c]  }| j                   |   j                   }}|S c c}w )zReturn the list of attribute types.

        Returns
        -------
        attr_types : list of str
            The attribute types.
        )r  r(   )r   r   
attr_typess      r   typeszMetaData.types  sF     #'"2"24"2$ &&t,66"2 	 44s    3N)
r	   r
   r   __doc__r   r  r  r  r  r  r   r   r   r   r     s%    85&,
&
r   r   c                     t        | d      r| }nt        |       }	 t        |      || ur|j                          S S # || ur|j                          w w xY w)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   r   r     sU    L q&Q>KKM 5>KKM s	   
< Ac                   	
 	 t        |       \  }	d}	D ]  }t	        |t
              sd} t        |	      }|rt        d      t        	      
d	
fd	}t         ||             }t        j                  |	D cg c]  }|j                  |j                  f c}      }||fS # t        $ r}dt        |      z   }t        |      |d }~ww xY wc c}w )Nz'Error while parsing header, error was: FTz*String attributes not supported yet, sorryc           
   3   &  K   t        t                    }d }| D ]l  }t        j                  |      st        j                  |      r.t        ||      \  }}t        |D cg c]  }|   j                  ||          c}       n y c c}w wr   )r   r   r  r>   r_emptyr?   rA   r%   )	row_iterr   r   r   r   r   r3   r   nis	          r   	generatorz_loadarff.<locals>.generatorI  s      U2YC s#w}}S'9*38LCUCUa++CF3UCDD  Ds   AB"B
 B)r'   )r  rB   rL   r   
isinstancerp   r   NotImplementedErrorr1   r   r   r   r   r   )r   r  r   rQ   hasstrr   metar)  rl   r   r(  s            @@r   r!  r!  *  s    )&	T Fa)F  CD  ""NOO	TBE8 	YuA88A484a)489D:u  )7#a&@S!q()r 9s   B( >C
(	C1CCc                     | j                   dz  | j                   dz
  z  }t        j                  |       t        j                  |       t        j                  |       t        j
                  |       |z  fS re   rf   )rl   rm   s     r   basic_statsr/  n  sP    IINdii!m,E99T?BIIdORWWT]BFF4L5<PPPr   c                     |j                   }|dk(  s
|dk(  s|dk(  r1t        |      \  }}}}t        |  d| d|dd|dd|dd|d       y t        t        |             y )NrX   r]   integerr'   r#  )r(   r/  printrL   )r   tprl   r   minr9   rj   rk   s           r   print_attributer5  s  sq    <<DyDFNdi.?)$/S$avQs1gQs1gQtAhaAw?@c"gr   c                     t        |       \  }}t        t        |j                               t        |j                         |D ]  }t        |||   ||           y r   )r   r2  r1   r   rg   r5  )filenamerl   r-  r3   s       r   	test_wekar8  |  sJ    (#JD$	#djj/	$))47DG, r   F__main__r<   r   )0r   r   numpyr   r   r   __all__r   r_metar  r&  r   r  r  r   r=   r   r   r   OSErrorr   r   r   r-   rV   rp   ru   r   r   r   r   r?   r   r   r   r   r  r   r   r!  r/  r5  r8  __test__r	   sysargvr7  r   r   r   <module>rA     s   	   
  "
A$ 
H	BJJu	
"**X
rzz+&RZZ-.
RZZEF
bjjNOBJJy!		<	= rzz-.

,-	 		Y 	0 0<Hy HV;5y ;5|i 0P:I P:f->) ->f	? /)dFB J, >G GTNb>HQ
- 	  zxx{Hh r   