
\c           @   s  d  Z  d d l Z d d l m Z d5 Z d	 Z d
   Z d e f d     YZ d   Z	 d   Z
 d   Z d   Z d   Z d   Z d e f d     YZ d Z d e j d e j  f d e j d j e   f d e j d  f d e j d  f d e j d e j  f g Z d   Z d d   Z d d!  Z d"   Z d#   Z d$   Z d%   Z d& e f d'     YZ d(   Z d)   Z  d*   Z! d+ e f d,     YZ" d- e" f d.     YZ# d/ e" f d0     YZ$ d1 e$ f d2     YZ% d3 e" f d4     YZ& d S(6   s   
    babel.numbers
    ~~~~~~~~~~~~~

    CLDR Plural support.  See UTS #35.

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
iN(   t   decimalt   zerot   onet   twot   fewt   manyt   otherc         C   s)  t  |   } t |  } t | t  rT | | k r< | } qT t j t |   } n  t | t j  r| j   } | j } | d k  r | j	 | n d } d j
 d   | D  } | j d  } t |  } t |  }	 t | p d  }
 t | p d  } n d } }	 }
 } | | | |	 |
 | f S(   s#  Extract operands from a decimal, a float or an int, according to `CLDR rules`_.

    The result is a 6-tuple (n, i, v, w, f, t), 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.
    ====== ===============================================================

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

    :param source: A real number
    :type source: int|float|decimal.Decimal
    :return: A n-i-v-w-f-t tuple
    :rtype: tuple[decimal.Decimal, int, int, int, int, int]
    i    t    c         s   s   |  ] } t  |  Vq d  S(   N(   t   str(   t   .0t   d(    (    s+   lib/python2.7/site-packages/babel/plural.pys	   <genexpr>A   s    t   0(    (   t   abst   intt
   isinstancet   floatR    t   DecimalR   t   as_tuplet   exponentt   digitst   joint   rstript   len(   t   sourcet   nt   it	   dec_tuplet   expt   fraction_digitst   trailingt   no_trailingt   vt   wt   ft   t(    (    s+   lib/python2.7/site-packages/babel/plural.pyt   extract_operands   s$    		t
   PluralRulec           B   st   e  Z d  Z d Z d   Z d   Z e d    Z e d    Z	 e d   d d	 Z
 d
   Z d   Z d   Z RS(   sf  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
    t   abstractt   _funcc         C   s   t  | t  r | j   } n  t   } g  |  _ x t t |   D] \ } } | t k rn t d |   n | | k r t d |   n  | j	 |  t
 |  j } | rC |  j j | | f  qC qC Wd S(   s$  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
        s   unknown tag %rs   tag %r defined twiceN(   R   t   dictt   itemst   setR%   t   sortedt   listt   _plural_tagst
   ValueErrort   addt   _Parsert   astt   append(   t   selft   rulest   foundt   keyt   exprR0   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   __init__c   s    		c      	   C   sV   |  j  } d t |   j d j g  t D]& } | | k r% d | | | f ^ q%  f S(   Ns   <%s %r>s   , s   %s: %s(   R3   t   typet   __name__R   R,   (   R2   R3   t   tag(    (    s+   lib/python2.7/site-packages/babel/plural.pyt   __repr__y   s
    	c         C   s   t  | |   r | S|  |  S(   s
  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   (   t   clsR3   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   parse   s    c         C   s>   t    j } t g  |  j D] \ } } | | |  f ^ q  S(   s   The `PluralRule` as a dict of unicode plural rules.

        >>> rule = PluralRule({'one': 'n is 1'})
        >>> rule.rules
        {'one': 'n is 1'}
        (   t   _UnicodeCompilert   compileR'   R%   (   R2   t   _compileR:   R0   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR3      s    c         C   s$   t  g  |  j D] } | d ^ q  S(   Ni    (   t	   frozensetR%   (   t   xR   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   <lambda>   R   t   docs   
        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.c         C   s   |  j  S(   N(   R%   (   R2   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   __getstate__   s    c         C   s   | |  _  d  S(   N(   R%   (   R2   R%   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   __setstate__   s    c         C   s.   t  |  d  s! t |   |  _ n  |  j |  S(   NR&   (   t   hasattrt	   to_pythonR&   (   R2   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   __call__   s    (   R%   R&   (   R9   t
   __module__t   __doc__t	   __slots__R7   R;   t   classmethodR=   t   propertyR3   t   tagsRE   RF   RI   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyR$   L   s   					c         C   ss   t    j } d g } x= t j |   j D]) \ } } | j d | |  | f  q( W| j d t  d j |  S(   s  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
    s   (function(n) { return s
   %s ? %r : s   %r; })R   (   t   _JavaScriptCompilerR?   R$   R=   R%   R1   t   _fallback_tagR   (   t   rulet   to_jst   resultR:   R0   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   to_javascript   s    	!c         C   s   i t  d 6t d 6t d 6t d 6} t   j } d d g } xC t j |   j D]/ \ } } | j	 d | |  t
 |  f  qM W| j	 d t  t d	 j |  d
 d  } t | |  | d S(   s<  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
    t   INt   WITHINt   MODR#   s   def evaluate(n):s'    n, i, v, w, f, t = extract_operands(n)s    if (%s): return %rs
    return %rs   
s   <rule>t   exect   evaluate(   t   in_range_listt   within_range_listt   cldr_moduloR#   t   _PythonCompilerR?   R$   R=   R%   R1   R   RQ   R   t   eval(   RR   t	   namespacet   to_python_funcRT   R:   R0   t   code(    (    s+   lib/python2.7/site-packages/babel/plural.pyRH      s    
	'c         C   s   t  j |   }  |  j t h B} t   j } g  t D] } | | k r2 | ^ q2 j } d t |  g } x: |  j	 D]/ \ } } | j
 d | |  | |  f  qp W| j
 d | t   d j |  S(   s~  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
    s   nplurals=%d; plural=(s
   %s ? %d : s   %d)R   (   R$   R=   RO   RQ   t   _GettextCompilerR?   R,   t   indexR   R%   R1   R   (   RR   t	   used_tagsR@   R:   t
   _get_indexRT   R0   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt
   to_gettext   s    
('c         C   s   |  t  |   k o t |  |  S(   s  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\   (   t   numt
   range_list(    (    s+   lib/python2.7/site-packages/babel/plural.pyR[      s    c            s   t    f d   | D  S(   s  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   s-   |  ]# \ } }   | k o$   | k Vq d  S(   N(    (   R	   t   min_t   max_(   Rh   (    s+   lib/python2.7/site-packages/babel/plural.pys	   <genexpr>$  s    (   t   any(   Rh   Ri   (    (   Rh   s+   lib/python2.7/site-packages/babel/plural.pyR\     s    c         C   s_   d } |  d k  r% |  d 9}  d } n  | d k  r> | d 9} n  |  | } | r[ | d 9} n  | S(   s   Javaish 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
    i    ii   (    (   t   at   bt   reverset   rv(    (    s+   lib/python2.7/site-packages/babel/plural.pyR]   '  s    
	
t	   RuleErrorc           B   s   e  Z d  Z RS(   s   Raised if a rule is malformed.(   R9   RJ   RK   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyRq   >  s   t   nivwfts   \s+t   words)   \b(and|or|is|(?:with)?in|not|mod|[{0}])\bt   values   \d+t   symbols   %|,|!=|=t   ellipsiss   \.{2,3}|\u2026c         C   s   |  j  d  d }  g  } d } t |   } x | | k  r xx t D]\ \ } } | j |  |  } | d  k	 rA | j   } | r | j | | j   f  n  PqA qA Wt d |  |   q. W| d  d  d  S(   Nt   @i    s5   malformed CLDR pluralization rule.  Got unexpected %ri(	   t   splitR   t   _RULESt   matcht   Nonet   endR1   t   groupRq   (   t   sRT   t   posR|   t   tokRR   Rz   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   tokenize_ruleM  s    c         C   s8   |  o7 |  d d | k o7 | d  k p7 |  d d | k S(   Nii    i   (   R{   (   t   tokenst   type_Rt   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   test_next_token`  s    c         C   s    t  |  | |  r |  j   Sd  S(   N(   R   t   pop(   R   R   Rt   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt
   skip_tokene  s    c         C   s   d |  f f S(   NRt   (    (   Rt   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt
   value_nodej  s    c         C   s
   |  d f S(   N(    (    (   t   name(    (    s+   lib/python2.7/site-packages/babel/plural.pyt
   ident_noden  s    c         C   s
   d |  f S(   NRi   (    (   Ri   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   range_list_noder  s    c         C   s   d |  f f S(   Nt   not(    (   Rp   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   negatev  s    R/   c           B   sn   e  Z d  Z d   Z d d d  Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z RS(   s  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         C   s_   t  |  |  _ |  j s% d  |  _ d  S|  j   |  _ |  j r[ t d |  j d d   n  d  S(   Ns   Expected end of rule, got %rii   (   R   R   R{   R0   t	   conditionRq   (   R2   t   string(    (    s+   lib/python2.7/site-packages/babel/plural.pyR7     s    			c         C   s   t  |  j | |  } | d  k	 r% | S| d  k rR t | d  k rF | pI |  } n  |  j sn t d |   n  t d | |  j d d f   d  S(   Ns#   expected %s but end of rule reacheds   expected %s but got %rii   (   R   R   R{   t   reprRq   (   R2   R   Rt   t   termt   token(    (    s+   lib/python2.7/site-packages/babel/plural.pyt   expect  s    !	c         C   sD   |  j    } x1 t |  j d d  r? d | |  j    f f } q W| S(   NRs   t   or(   t   and_conditionR   R   (   R2   t   op(    (    s+   lib/python2.7/site-packages/babel/plural.pyR     s    c         C   sD   |  j    } x1 t |  j d d  r? d | |  j    f f } q W| S(   NRs   t   and(   t   relationR   R   (   R2   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR     s    c         C   s   |  j    } t |  j d d  rR t |  j d d  r< d p? d | |  j   f f St |  j d d  } d } t |  j d d  r d } n7 t |  j d d  s | r t d   n  |  j |  Sd | | |  j   f f } | r t |  S| S(	   NRs   t   isR   t   isnott   int   withins#   Cannot negate operator based rules.R   (   R6   R   R   Rt   Rq   t   newfangled_relationRi   R   (   R2   t   leftt   negatedt   methodRp   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR     s    	c         C   sw   t  |  j d d  r t } n* t  |  j d d  r< t } n t d   d d | |  j   f f } | rs t |  S| S(   NRu   t   =s   !=s'   Expected "=" or "!=" or legacy relationR   R   (   R   R   t   Falset   TrueRq   Ri   R   (   R2   R   R   Rp   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR     s    		c         C   s<   |  j    } t |  j d  r. | |  j    f S| | f Sd  S(   NRv   (   Rt   R   R   (   R2   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   range_or_value  s    c         C   sH   |  j    g } x, t |  j d d  r= | j |  j     q Wt |  S(   NRu   t   ,(   R   R   R   R1   R   (   R2   Ri   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRi     s    c         C   s   t  |  j d  } | d  k s. | d t k r= t d   n  | d } t  |  j d d  rx d | d f |  j   f f St  |  j d d  r d | d f |  j   f f St |  S(	   NRs   i   s   Expected identifier variablet   modRu   t   %(    (    (   R   R   R{   t   _VARSRq   Rt   R   (   R2   Rs   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR6     s    
c         C   s   t  t |  j d  d   S(   NRt   i   (   R   R   R   (   R2   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRt     s    N(   R9   RJ   RK   R7   R{   R   R   R   R   R   R   Ri   R6   Rt   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyR/   z  s    	
				
			c            s     f d   S(   s%   Compiler factory for the `_Compiler`.c            s      |  j  |  |  j  |  f S(   N(   R?   (   R2   t   lt   r(   t   tmpl(    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   (    (   R   (    (   R   s+   lib/python2.7/site-packages/babel/plural.pyt   _binary_compiler  s    c            s     f d   S(   s%   Compiler factory for the `_Compiler`.c            s     |  j  |  S(   N(   R?   (   R2   RB   (   R   (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   (    (   R   (    (   R   s+   lib/python2.7/site-packages/babel/plural.pyt   _unary_compiler  s    c         C   s   d S(   NR   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   t	   _Compilerc           B   s   e  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 RS(   sZ   The compilers are able to transform the expressions into multiple
    output formats.
    c         C   s#   | \ } } t  |  d |  |   S(   Nt   compile_(   t   getattr(   R2   t   argR   t   args(    (    s+   lib/python2.7/site-packages/babel/plural.pyR?     s    c         C   s   d S(   NR   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s   d S(   NR   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s   d S(   NR   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s   d S(   NR    (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s   d S(   NR!   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s   d S(   NR"   (    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   c         C   s
   t  |  S(   N(   R   (   RB   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC     R   s
   (%s && %s)s
   (%s || %s)s   (!%s)s
   (%s %% %s)s
   (%s == %s)s
   (%s != %s)c         C   s   t     d  S(   N(   t   NotImplementedError(   R2   R   R6   Ri   (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   compile_relation  s    (   R9   RJ   RK   R?   t	   compile_nt	   compile_it	   compile_vt	   compile_wt	   compile_ft	   compile_tt   compile_valueR   t   compile_andt
   compile_orR   t   compile_nott   compile_modt
   compile_ist   compile_isnotR   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyR     s    								R^   c           B   sG   e  Z d  Z e d  Z e d  Z e d  Z e d  Z d   Z	 RS(   s!   Compiles an expression to Python.s   (%s and %s)s
   (%s or %s)s   (not %s)s   MOD(%s, %s)c      	   C   s`   d d j  g  | d D]" } d t t |  j |   ^ q  } d | j   |  j |  | f S(   Ns   [%s]R   i   s   (%s, %s)s
   %s(%s, %s)(   R   t   tuplet   mapR?   t   upper(   R2   R   R6   Ri   t   range_t   compile_range_list(    (    s+   lib/python2.7/site-packages/babel/plural.pyR   %  s
    	4(
   R9   RJ   RK   R   R   R   R   R   R   R   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyR^     s   Rc   c           B   s8   e  Z d  Z e j Z e Z e Z e Z	 e Z
 d   Z RS(   s)   Compile into a gettext plural expression.c         C   s   g  } |  j  |  } x | d D]v } | d | d k ra | j d | |  j  | d  f  q  t |  j  |  \ } } | j d | | | | f  q  Wd d j |  S(   Ni   i    s
   (%s == %s)s   (%s >= %s && %s <= %s)s   (%s)s    || (   R?   R1   R   R   (   R2   R   R6   Ri   Rp   t   itemt   mint   max(    (    s+   lib/python2.7/site-packages/babel/plural.pyR   6  s    		(   R9   RJ   RK   R   R   R   t   compile_zeroR   R   R   R   R   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyRc   -  s   	RP   c           B   s8   e  Z d  Z d   Z e Z e Z e Z e Z d   Z	 RS(   s/   Compiles the expression to plain of JavaScript.c         C   s   d S(   Ns   parseInt(n, 10)(    (   RB   (    (    s+   lib/python2.7/site-packages/babel/plural.pyRC   O  R   c         C   sM   t  j |  | | |  } | d k rI |  j |  } d | | | f } n  | S(   NR   s   (parseInt(%s, 10) == %s && %s)(   Rc   R   R?   (   R2   R   R6   Ri   Rb   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR   U  s    (
   R9   RJ   RK   R   R   R   R   R   R   R   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyRP   J  s   	R>   c           B   s_   e  Z d  Z e d  Z e d  Z e d  Z e d  Z e d  Z d   Z	 e
 d  Z RS(   s+   Returns a unicode pluralization rule again.s   %s is %ss   %s is not %ss	   %s and %ss   %s or %ss	   %s mod %sc         C   s   |  j  d t | d  S(   NR   i   (   R   R   (   R2   R   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR   k  s    c         C   s   g  } xf | d D]Z } | d | d k rH | j  |  j | d   q | j  d t t |  j |    q Wd |  j |  | r d p d | d j |  f S(   Ni   i    s   %s..%ss
   %s%s %s %ss    notR   R   (   R1   R?   R   R   R   (   R2   R   R6   Ri   R   t   rangesR   (    (    s+   lib/python2.7/site-packages/babel/plural.pyR   n  s    '(   R9   RJ   RK   R   R   R   R   R   R   R   R   R   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyR>   ^  s   	(   R   R   R   R   R   R   ('   RK   t   ret   babel._compatR    R,   RQ   R#   t   objectR$   RU   RH   Rg   R[   R\   R]   t	   ExceptionRq   R   R{   R?   t   UNICODEt   formatRy   R   R   R   R   R   R   R   R/   R   R   R   R   R^   Rc   RP   R>   (    (    (    s+   lib/python2.7/site-packages/babel/plural.pyt   <module>
   sH   	8]		(									{			