
    QcQV              	       b   d Z ddlZddlZdZdZd Z G d d          Zd Zd	 Zd
 Z	d Z
d Zd Z G d de          Zh dZd ej        dej                  fd ej        dd                    e           d          fd ej        d          fd ej        d          fd ej        dej                  fgZd Zd2dZd2dZd Zd  Zd! Zd" Z G d# d$          Zd% Zd& Zd' Z G d( d)          Z G d* d+e          Z  G d, d-e          Z! G d. d/e!          Z" G d0 d1e          Z#dS )3z
    babel.numbers
    ~~~~~~~~~~~~~

    CLDR Plural support.  See UTS #35.

    :copyright: (c) 2013-2022 by the Babel Team.
    :license: BSD, see LICENSE for more details.
    N)zeroonetwofewmanyotherr   c                 j   t          |           }t          |          }t          |t                    r*||k    r|}n!t	          j        t          |                    }t          |t          j                  r|                                }|j        }|dk     r|j	        |d         nd}d
                    d |D                       }|                    d          }t          |          }t          |          }	t          |pd          }
t          |pd          }ndx}x}	x}
}dx}}||||	|
|||fS )u  Extract operands from a decimal, a float or an int, according to `CLDR rules`_.

    The result is a 8-tuple (n, i, v, w, f, t, c, e), where those symbols are as follows:

    ====== ===============================================================
    Symbol Value
    ------ ---------------------------------------------------------------
    n      absolute value of the source number (integer and decimals).
    i      integer digits of n.
    v      number of visible fraction digits in n, with trailing zeros.
    w      number of visible fraction digits in n, without trailing zeros.
    f      visible fractional digits in n, with trailing zeros.
    t      visible fractional digits in n, without trailing zeros.
    c      compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
    e      currently, synonym for ‘c’. however, may be redefined in the future.
    ====== ===============================================================

    .. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-61/tr35-numbers.html#Operands

    :param source: A real number
    :type source: int|float|decimal.Decimal
    :return: A n-i-v-w-f-t-c-e tuple
    :rtype: tuple[decimal.Decimal, int, int, int, int, int, int, int]
    r   N  c              3   4   K   | ]}t          |          V  d S Nstr).0ds     ,lib/python3.11/site-packages/babel/plural.py	<genexpr>z#extract_operands.<locals>.<genexpr>A   s(      ;;a3q66;;;;;;    0)absint
isinstancefloatdecimalDecimalr   as_tupleexponentdigitsjoinrstriplen)sourceni	dec_tupleexpfraction_digitstrailingno_trailingvwftces                 r   extract_operandsr0      s@   2 	FAAA!U (6 	(AA A''A!W_%% JJLL	 47!GC)*3440077;;?;;;;;ooc**MMA q!!AAIAaAq!Q!!r   c                   |    e Zd ZdZdZd Zd Zed             Ze	d             Z
 e	d d	          Zd
 Zd Zd ZdS )
PluralRuleaf  Represents a set of language pluralization rules.  The constructor
    accepts a list of (tag, expr) tuples or a dict of `CLDR rules`_. The
    resulting object is callable and accepts one parameter with a positive or
    negative number (both integer and float) for the number that indicates the
    plural form for a string and returns the tag for the format:

    >>> rule = PluralRule({'one': 'n is 1'})
    >>> rule(1)
    'one'
    >>> rule(2)
    'other'

    Currently the CLDR defines these tags: zero, one, two, few, many and
    other where other is an implicit default.  Rules should be mutually
    exclusive; for a given numeric value, only one rule should apply (i.e.
    the condition should only be true for one of the plural rule elements.

    .. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-33/tr35-numbers.html#Language_Plural_Rules
    )abstract_funcc                    t          |t                    r|                                }t                      }g | _        t          t          |                    D ]}\  }}|t          vrt          d|z            ||v rt          d|z            |	                    |           t          |          j        }|r| j                            ||f           ~dS )a$  Initialize the rule instance.

        :param rules: a list of ``(tag, expr)``) tuples with the rules
                      conforming to UTS #35 or a dict with the tags as keys
                      and expressions as values.
        :raise RuleError: if the expression is malformed
        zunknown tag %rztag %r defined twiceN)r   dictitemssetr3   sortedlist_plural_tags
ValueErroradd_Parserastappend)selfrulesfoundkeyexprr?   s         r   __init__zPluralRule.__init__d   s     eT"" 	"KKMMEU,, 	1 	1IC,& ? !1C!7888 ? !7#!=>>>IIcNNN$--#C 1$$c3Z000	1 	1r   c                     | j         dt          |           j        dd                    fdt          D                       dS )N< , c                 2    g | ]}|v |d |         S )z: r
   )r   tagrB   s     r   
<listcomp>z'PluralRule.__repr__.<locals>.<listcomp>~   s@     ( ( (,(333c

3 ( ( (r   >)rB   type__name__r   r;   )rA   rB   s    @r   __repr__zPluralRule.__repr__z   sh    
JJII ( ( ( (| ( ( ( ) ) ) )
 	
r   c                 <    t          ||           r|S  | |          S )a
  Create a `PluralRule` instance for the given rules.  If the rules
        are a `PluralRule` object, that object is returned.

        :param rules: the rules as list or dict, or a `PluralRule` object
        :raise RuleError: if the expression is malformed
        )r   )clsrB   s     r   parsezPluralRule.parse   s)     eS!! 	Ls5zzr   c                 P    t                      j        fd| j        D             S )zThe `PluralRule` as a dict of unicode plural rules.

        >>> rule = PluralRule({'one': 'n is 1'})
        >>> rule.rules
        {'one': 'n is 1'}
        c                 .    i | ]\  }}| |          S r
   r
   )r   rL   r?   _compiles      r   
<dictcomp>z$PluralRule.rules.<locals>.<dictcomp>   s'    AAAxsCXXc]]AAAr   )_UnicodeCompilercompiler3   )rA   rW   s    @r   rB   zPluralRule.rules   s/     $%%-AAAA4=AAAAr   c                 >    t          d | j        D                       S )Nc              3   &   K   | ]}|d          V  dS )r   Nr
   )r   r$   s     r   r   z&PluralRule.<lambda>.<locals>.<genexpr>   s&      'A'A!'A'A'A'A'A'Ar   )	frozensetr3   xs    r   <lambda>zPluralRule.<lambda>   s    i'A'Aaj'A'A'AAA r   z
        A set of explicitly defined tags in this rule.  The implicit default
        ``'other'`` rules is not part of this set unless there is an explicit
        rule for it.)docc                     | j         S r   r3   rA   s    r   __getstate__zPluralRule.__getstate__   s
    }r   c                     || _         d S r   rc   )rA   r3   s     r   __setstate__zPluralRule.__setstate__   s     r   c                 t    t          | d          st          |           | _        |                     |          S )Nr4   )hasattr	to_pythonr4   )rA   r#   s     r   __call__zPluralRule.__call__   s1    tW%% 	)"4DJzz!}}r   N)rP   
__module____qualname____doc__	__slots__rF   rQ   classmethodrT   propertyrB   tagsre   rg   rk   r
   r   r   r2   r2   M   s         ( &I1 1 1,
 
 
 	 	 [	 B B XB 8AA H   D
  ! ! !    r   r2   c                 $   t                      j        }dg}t                              |           j        D ])\  }}|                     ||          d|d           *|                    dt          z             d                    |          S )a  Convert a list/dict of rules or a `PluralRule` object into a JavaScript
    function.  This function depends on no external library:

    >>> to_javascript({'one': 'n is 1'})
    "(function(n) { return (n == 1) ? 'one' : 'other'; })"

    Implementation detail: The function generated will probably evaluate
    expressions involved into range operations multiple times.  This has the
    advantage that external helper functions are not required and is not a
    big performance hit for these simple calculations.

    :param rule: the rules as list or dict, or a `PluralRule` object
    :raise RuleError: if the expression is malformed
    z(function(n) { return z ? z : z%r; })r   )_JavaScriptCompilerrZ   r2   rT   r3   r@   _fallback_tagr   )ruleto_jsresultrL   r?   s        r   to_javascriptry      s      !!)E&'F$$T**3 8 8SeeCjjjj###67777
MM(]*+++776??r   c           	         t           t          t          t          d}t	                      j        }ddg}t                              |           j        D ]6\  }}|	                    d ||          dt          |                     7|	                    dt          z             t          d                    |          dd	          }t          ||           |d
         S )a<  Convert a list/dict of rules or a `PluralRule` object into a regular
    Python function.  This is useful in situations where you need a real
    function and don't are about the actual rule object:

    >>> func = to_python({'one': 'n is 1', 'few': 'n in 2..4'})
    >>> func(1)
    'one'
    >>> func(3)
    'few'
    >>> func = to_python({'one': 'n in 1,11', 'few': 'n in 3..10,13..19'})
    >>> func(11)
    'one'
    >>> func(15)
    'few'

    :param rule: the rules as list or dict, or a `PluralRule` object
    :raise RuleError: if the expression is malformed
    )INWITHINMODr0   zdef evaluate(n):z- n, i, v, w, f, t, c, e = extract_operands(n)z if (z
): return z
 return %r
z<rule>execevaluate)in_range_listwithin_range_listcldr_modulor0   _PythonCompilerrZ   r2   rT   r3   r@   r   ru   r   eval)rv   	namespaceto_python_funcrx   rL   r?   codes          r   rj   rj      s    ( #,	 I %&&.N7F $$T**3 O OS 	~~c/B/B/B/BCHHHMNNNN
MM,.///499V$$h77DyZ  r   c                    t                               |           } | j        t          hz  t	                      j        }fdt          D             j        }dt                    z  g}| j	        D ]1\  }}|
                    d ||           ||          fz             2|
                    d |t                    z             d                    |          S )a  The plural rule as gettext expression.  The gettext expression is
    technically limited to integers and returns indices rather than tags.

    >>> to_gettext({'one': 'n is 1', 'two': 'n is 2'})
    'nplurals=3; plural=((n == 1) ? 0 : (n == 2) ? 1 : 2);'

    :param rule: the rules as list or dict, or a `PluralRule` object
    :raise RuleError: if the expression is malformed
    c                     g | ]}|v |	S r
   r
   )r   rL   	used_tagss     r   rM   zto_gettext.<locals>.<listcomp>   s#    BBB#	1AB#BBBr   znplurals=%d; plural=(z
%s ? %d : z%d);r   )r2   rT   rr   ru   _GettextCompilerrZ   r;   indexr!   r3   r@   r   )rv   rW   
_get_indexrx   rL   r?   r   s         @r   
to_gettextr      s     D!!D	]O+I!!)HBBBBBBBHJ%I67FM G GSlhhsmmZZ__%EEFFFF
MM&::m444555776??r   c                 H    | t          |           k    ot          | |          S )a  Integer range list test.  This is the callback for the "in" operator
    of the UTS #35 pluralization rule language:

    >>> in_range_list(1, [(1, 3)])
    True
    >>> in_range_list(3, [(1, 3)])
    True
    >>> in_range_list(3, [(1, 3), (5, 8)])
    True
    >>> in_range_list(1.2, [(1, 4)])
    False
    >>> in_range_list(10, [(1, 4)])
    False
    >>> in_range_list(10, [(1, 4), (6, 8)])
    False
    )r   r   num
range_lists     r   r   r      s$    " #c((?A0jAAAr   c                 :     t           fd|D                       S )a  Float range test.  This is the callback for the "within" operator
    of the UTS #35 pluralization rule language:

    >>> within_range_list(1, [(1, 3)])
    True
    >>> within_range_list(1.0, [(1, 3)])
    True
    >>> within_range_list(1.2, [(1, 4)])
    True
    >>> within_range_list(8.8, [(1, 4), (7, 15)])
    True
    >>> within_range_list(10, [(1, 4)])
    False
    >>> within_range_list(10.5, [(1, 4), (20, 30)])
    False
    c              3   6   K   | ]\  }}|k    o|k    V  d S r   r
   )r   min_max_r   s      r   r   z$within_range_list.<locals>.<genexpr>%  s4      HHztTsd{*sd{HHHHHHr   )anyr   s   ` r   r   r     s(    " HHHHZHHHHHHr   c                 R    d}| dk     r| dz  } d}|dk     r|dz  }| |z  }|r|dz  }|S )zJavaish modulo.  This modulo operator returns the value with the sign
    of the dividend rather than the divisor like Python does:

    >>> cldr_modulo(-3, 5)
    -3
    >>> cldr_modulo(-3, -5)
    -3
    >>> cldr_modulo(3, 5)
    3
    r      r
   )abreverservs       r   r   r   (  sW     G1u 	R1u 	R	
QB 
bIr   c                       e Zd ZdZdS )	RuleErrorzRaised if a rule is malformed.N)rP   rl   rm   rn   r
   r   r   r   r   ?  s        ((((r   r   >   r.   r/   r,   r$   r#   r-   r*   r+   z\s+wordz"\b(and|or|is|(?:with)?in|not|mod|[r   z])\bvaluez\d+symbolz%|,|!=|=ellipsisz\.{2,3}|\u2026c                    |                      d          d         } g }d}t          |           }||k     rt          D ]^\  }}|                    | |          }|A|                                }|r)|                    ||                                f            n_t          d| |         z            ||k     |d d d         S )N@r   z5malformed CLDR pluralization rule.  Got unexpected %rr   )splitr!   _RULESmatchendr@   groupr   )srx   posr   tokrv   r   s          r   tokenize_ruler   V  s    	QAF
C
a&&C
) 
: 		: 		:ICJJq#&&E iikk 8MM3"6777	  023C&9 : : : ) 
: $$B$<r   c                 V    | o'| d         d         |k    o|d u p| d         d         |k    S )Nr   r   r   r
   tokenstype_r   s      r   test_next_tokenr   i  s<     2fRjmu, 2	$	0&*Q-502r   c                 P    t          | ||          r|                                 S d S r   )r   popr   s      r   
skip_tokenr   n  s.    vue,, zz|| r   c                     d| ffS )Nr   r
   )r   s    r   
value_noder   s  s    UIr   c                 
    | dfS )Nr
   r
   )names    r   
ident_noder   w  s    8Or   c                 
    d| fS )Nr   r
   )r   s    r   range_list_noder   {  s    ##r   c                     d| ffS )Nnotr
   )r   s    r   negater     s    2%<r   c                   P    e Zd ZdZd ZddZd Zd Zd Zd Z	d	 Z
d
 Zd Zd ZdS )r>   u  Internal parser.  This class can translate a single rule into an abstract
    tree of tuples. It implements the following grammar::

        condition     = and_condition ('or' and_condition)*
                        ('@integer' samples)?
                        ('@decimal' samples)?
        and_condition = relation ('and' relation)*
        relation      = is_relation | in_relation | within_relation
        is_relation   = expr 'is' ('not')? value
        in_relation   = expr (('not')? 'in' | '=' | '!=') range_list
        within_relation = expr ('not')? 'within' range_list
        expr          = operand (('mod' | '%') value)?
        operand       = 'n' | 'i' | 'f' | 't' | 'v' | 'w'
        range_list    = (range | value) (',' range_list)*
        value         = digit+
        digit         = 0|1|2|3|4|5|6|7|8|9
        range         = value'..'value
        samples       = sampleRange (',' sampleRange)* (',' ('…'|'...'))?
        sampleRange   = decimalValue '~' decimalValue
        decimalValue  = value ('.' value)?

    - Whitespace can occur between or around any of the above tokens.
    - Rules should be mutually exclusive; for a given numeric value, only one
      rule should apply (i.e. the condition should only be true for one of
      the plural rule elements).
    - The in and within relations can take comma-separated lists, such as:
      'n in 3,5,7..15'.
    - Samples are ignored.

    The translator parses the expression on instanciation into an attribute
    called `ast`.
    c                     t          |          | _        | j        s	d | _        d S |                                 | _        | j        r#t	          d| j        d         d         z            d S )NzExpected end of rule, got %rr   r   )r   r   r?   	conditionr   )rA   strings     r   rF   z_Parser.__init__  sv    #F++{ 	 DHF>>##; 	0: KOA./ 0 0 0	0 	0r   Nc                     t          | j        ||          }||S |t          |d u r|p|          }| j        st          d|z            t          d|d| j        d         d                   )Nz#expected %s but end of rule reachedz	expected z	 but got r   r   )r   r   reprr   )rA   r   r   termtokens        r   expectz_Parser.expect  s    4;u55 	L 	:/%8599D{ 	JADHIIIiDDD$+b/!:L:LMNNNr   c                     |                                  }t          | j        dd          r.d||                                  ff}t          | j        dd          .|S )Nr   or)and_conditionr   r   rA   ops     r   r   z_Parser.condition  sa    !!fd33 	2D..0011B fd33 	2	r   c                     |                                  }t          | j        dd          r.d||                                  ff}t          | j        dd          .|S )Nr   and)relationr   r   r   s     r   r   z_Parser.and_condition  sY    ]]__fe44 	.T]]__--B fe44 	.	r   c                    |                                  }t          | j        dd          r0t          | j        dd          rdpd||                                 ffS t          | j        dd          }d}t          | j        dd          rd}n<t          | j        dd          s&|rt	          d          |                     |          S d|||                                 ff}|rt          |          n|S )	Nr   isr   isnotinwithinz#Cannot negate operator based rules.r   )rE   r   r   r   r   newfangled_relationr   r   )rA   leftnegatedmethodr   s        r   r   z_Parser.relation  s   yy{{dk6400 	%dk6599EgMtzz||$% %T[&%88dk6844 	6FFdk6488 6 K#$IJJJ//555&$(9(9::$,vbzzz",r   c                     t          | j        dd          rd}n(t          | j        dd          rd}nt          d          dd||                                 ff}|rt	          |          n|S )	Nr   =Fz!=Tz'Expected "=" or "!=" or legacy relationr   r   )r   r   r   r   r   )rA   r   r   r   s       r   r   z_Parser.newfangled_relation  s}    dk8S11 	GGGXt44 	GGGEFFF$doo&7&788$,vbzzz",r   c                     |                                  }t          | j        d          r||                                  fS ||fS )Nr   )r   r   r   )rA   r   s     r   range_or_valuez_Parser.range_or_value  s@    zz||dk:.. 	%%:r   c                     |                                  g}t          | j        dd          r=|                    |                                             t          | j        dd          =t	          |          S )Nr   ,)r   r   r   r@   r   )rA   r   s     r   r   z_Parser.range_list  sr    ))++,
h44 	5d1133444 h44 	5z***r   c                 Z   t          | j        d          }||d         t          vrt          d          |d         }t          | j        dd          rd|df|                                 ffS t          | j        dd          rd|df|                                 ffS t          |          S )Nr   r   zExpected identifier variablemodr
   r   %)r   r   _VARSr   r   r   )rA   r   r   s      r   rE   z_Parser.expr  s    $+v.. 	<47%/ 	<:;;;Awdk6511 	5D":tzz||444Xs33 	5D":tzz||444$r   c                 l    t          t          |                     d          d                             S )Nr   r   )r   r   r   rd   s    r   r   z_Parser.value  s)    #dkk'221566777r   )NN)rP   rl   rm   rn   rF   r   r   r   r   r   r   r   rE   r   r
   r   r   r>   r>     s         B
0 
0 
0O O O O    - - -"- - -  + + +	  	  	 8 8 8 8 8r   r>   c                       fdS )%Compiler factory for the `_Compiler`.c                 ^    |                      |          |                      |          fz  S r   rZ   )rA   lrtmpls      r   r`   z"_binary_compiler.<locals>.<lambda>   s%    ddll1oot||A%GG r   r
   r   s   `r   _binary_compilerr     s    GGGGGr   c                       fdS )r   c                 4    |                      |          z  S r   r   )rA   r_   r   s     r   r`   z!_unary_compiler.<locals>.<lambda>  s    4$,,q//1 r   r
   r   s   `r   _unary_compilerr     s    11111r   c                     dS )Nr   r
   r^   s    r   r`   r`     s     r   c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Zd ZdS )	_CompilerzZThe compilers are able to transform the expressions into multiple
    output formats.
    c                 8    |\  }} t          | d|z             | S )Ncompile_)getattr)rA   argr   argss       r   rZ   z_Compiler.compile  s&    D-wtZ"_--t44r   c                     dS )Nr#   r
   r^   s    r   r`   z_Compiler.<lambda>      # r   c                     dS )Nr$   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr*   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr+   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr,   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr-   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr.   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                     dS )Nr/   r
   r^   s    r   r`   z_Compiler.<lambda>  r   r   c                      t          |          S r   r   )r_   r*   s     r   r`   z_Compiler.<lambda>  s    Q r   z
(%s && %s)z
(%s || %s)z(!%s)z
(%s %% %s)z
(%s == %s)z
(%s != %s)c                     t                      r   )NotImplementedError)rA   r   rE   r   s       r   compile_relationz_Compiler.compile_relation$  s    !###r   N)rP   rl   rm   rn   rZ   	compile_n	compile_i	compile_v	compile_w	compile_f	compile_t	compile_c	compile_ecompile_valuer   compile_and
compile_orr   compile_notcompile_mod
compile_iscompile_isnotr  r
   r   r   r   r     s         5 5 5 IIIIIIII''M""<00K!!,//J!/'**K""<00K!!,//J$$\22M$ $ $ $ $r   r   c                   p    e Zd ZdZ ed          Z ed          Z ed          Z ed          Z	d Z
dS )r   z!Compiles an expression to Python.z(%s and %s)z
(%s or %s)z(not %s)zMOD(%s, %s)c                      dd                      fd|d         D                       z  }|                                d                     |          d|dS )Nz[%s]r   c           	      Z    g | ]'}d t          t          j        |                    z  (S )z(%s, %s))tuplemaprZ   )r   range_rA   s     r   rM   z4_PythonCompiler.compile_relation.<locals>.<listcomp>2  sB     * * * %DL& 9 9::: * * *r   r   (rJ   ))r   upperrZ   )rA   r   rE   r   compile_range_lists   `    r   r  z _PythonCompiler.compile_relation0  s    #chh* * * *%a=* * *'+ '+ +  &||~~~~t||D/A/A/A/A1113 	3r   N)rP   rl   rm   rn   r   r  r  r   r  r  r  r
   r   r   r   r   (  sh        ++""=11K!!,//J!/*--K""=11K3 3 3 3 3r   r   c                   6    e Zd ZdZej        ZeZeZ	eZ
eZd ZdS )r   z)Compile into a gettext plural expression.c                 z   g }|                      |          }|d         D ]}|d         |d         k    r6|                    d|d|                      |d                   d           Jt          | j         |          \  }}|                    d|d|d|d|d	           d	d
                    |          z  S )Nr   r   r  z == r  z >=  && z <= z(%s)z || )rZ   r@   r  r   )rA   r   rE   r   r   itemminmaxs           r   r  z!_GettextCompiler.compile_relationA  s    ||D!!qM 	 	DAw$q'! 			DDLLa))))    
 t|T22S			DDCCDDCC	     B''r   N)rP   rl   rm   rn   r   r	  r
  compile_zeror  r  r  r  r  r
   r   r   r   r   8  sE        33#IIIII( ( ( ( (r   r   c                   .    e Zd ZdZd ZeZeZeZeZ	d Z
dS )rt   z/Compiles the expression to plain of JavaScript.c                     dS )NzparseInt(n, 10)r
   r^   s    r   r`   z_JavaScriptCompiler.<lambda>Z  s    + r   c                     t                               | |||          }|dk    r!|                     |          }d|d|d|d}|S )Nr   z
(parseInt(z	, 10) == r$  r  )r   r  rZ   )rA   r   rE   r   r   s        r   r  z$_JavaScriptCompiler.compile_relation`  s]    00&$
, ,T> 	I<<%%DD7;ttTTT444HDr   N)rP   rl   rm   rn   r
  r(  r  r  r  r  r  r
   r   r   rt   rt   U  sG        99 ,+IIIII    r   rt   c                       e Zd ZdZ ed          Z ed          Z ed          Z ed          Z ed          Z	d Z
dd	Zd
S )rY   z+Returns a unicode pluralization rule again.z%s is %sz%s is not %sz	%s and %sz%s or %sz	%s mod %sc                 (     | j         |d         ddiS )Nr   r   T)r  )rA   r   s     r   r  z_UnicodeCompiler.compile_notv  s    $t$HQK@T@@@r   Fc           
      z   g }|d         D ]{}|d         |d         k    r/|                     |                     |d                              C|                     dt          t          | j        |                    z             ||                     |          |rdpdd|dd                    |          S )Nr   r   z%s..%sz notr   rI   r   )r@   rZ   r  r  r   )rA   r   rE   r   r   rangesr%  s          r   r  z!_UnicodeCompiler.compile_relationy  s    qM 	I 	IDAw$q'! Idll47334444hs4</F/F)G)GGHHHHLL 2F 8b 8 8FFCHHV$$$
 	
r   N)F)rP   rl   rm   rn   r   r  r  r  r  r  r  r  r
   r   r   rY   rY   i  s        55 "!*--J$$^44M"";//K!!*--J"";//KA A A

 

 

 

 

 

r   rY   r   )$rn   r   rer;   ru   r0   r2   ry   rj   r   r   r   r   	Exceptionr   r   rZ   UNICODEr   r   r   r   r   r   r   r   r   r>   r   r   r(  r   r   r   rt   rY   r
   r   r   <module>r3     sA     				 >8" 8" 8"vZ Z Z Z Z Z Z Zz  .%! %! %!P  .B B B(I I I(  .) ) ) ) )	 ) ) )		 		 		 
:2:fbj))*ZRZRbggennRRRSSTjbj  !zrz+&&'-rz::;
  &2 2 2 2
   
    $ $ $  x8 x8 x8 x8 x8 x8 x8 x8vH H H
2 2 2
 }$ $ $ $ $ $ $ $:3 3 3 3 3i 3 3 3 ( ( ( ( (y ( ( (:    *   (
 
 
 
 
y 
 
 
 
 
r   