
    Mh	                        d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
  e
            Zd Z	 	 dddZddgdgddgdgddgg ddgdZddZdS )aY  
    babel.lists
    ~~~~~~~~~~~

    Locale dependent formatting of lists.

    The default locale for the functions in this module is determined by the
    following environment variables, in that order:

     * ``LC_ALL``, and
     * ``LANG``

    :copyright: (c) 2015-2025 by the Babel Team.
    :license: BSD, see LICENSE for more details.
    )annotationsN)Sequence)Literal)Localedefault_localec                    | dk    r#t          j        dt          d           t          S t	          dt
          d|           )NDEFAULT_LOCALEzJThe babel.lists.DEFAULT_LOCALE constant is deprecated and will be removed.   )
stacklevelzmodule z has no attribute )warningswarnDeprecationWarning_DEFAULT_LOCALEAttributeError__name__)names    K/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/babel/lists.py__getattr__r      sW    X	
 	
 	
 	

 
I8IIII
J
JJ    standardlstSequence[str]style\Literal['standard', 'standard-short', 'or', 'or-short', 'unit', 'unit-short', 'unit-narrow']localeLocale | str | Nonereturnstrc                   t          j        |pt                    }| sdS t          |           dk    r| d         S t	          ||          }t          |           dk    rd|v r |d         j        |  S |d                             | d         | d                   }| dd         D ]}|d                             ||          }|d	                             || d                   }|S )
u  
    Format the items in `lst` as a list.

    >>> format_list(['apples', 'oranges', 'pears'], locale='en')
    u'apples, oranges, and pears'
    >>> format_list(['apples', 'oranges', 'pears'], locale='zh')
    u'apples、oranges和pears'
    >>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi')
    u'omena, peruna tai aplari'

    Not all styles are necessarily available in all locales.
    The function will attempt to fall back to replacement styles according to the rules
    set forth in the CLDR root XML file, and raise a ValueError if no suitable replacement
    can be found.

    The following text is verbatim from the Unicode TR35-49 spec [1].

    * standard:
      A typical 'and' list for arbitrary placeholders.
      eg. "January, February, and March"
    * standard-short:
      A short version of an 'and' list, suitable for use with short or abbreviated placeholder values.
      eg. "Jan., Feb., and Mar."
    * or:
      A typical 'or' list for arbitrary placeholders.
      eg. "January, February, or March"
    * or-short:
      A short version of an 'or' list.
      eg. "Jan., Feb., or Mar."
    * unit:
      A list suitable for wide units.
      eg. "3 feet, 7 inches"
    * unit-short:
      A list suitable for short units
      eg. "3 ft, 7 in"
    * unit-narrow:
      A list suitable for narrow units, where space on the screen is very limited.
      eg. "3′ 7″"

    [1]: https://www.unicode.org/reports/tr35/tr35-49/tr35-general.html#ListPatterns

    :param lst: a sequence of items to format in to a list
    :param style: the style to format the list with. See above for description.
    :param locale: the locale. Defaults to the system locale.
        r   r
   2startmiddleend)r   parser   len_resolve_list_styleformat)r   r   r   patternsresultelems         r   format_listr.   &   s    d \&3O44F r
3xx1}}1v"6511H
3xx1}}#x}#S))g%%c!fc!f55FAbD	 9 9(#**6488e_##FCG44FMr   or-shortorstandard-short
unit-short)r2   unitr   )z	or-narrowr/   zstandard-narrowr1   r3   zunit-narrowr2   r   c           
         |gt                               |g           R D ]}|| j        v r| j        |         c S t          d|  d|dt	          | j                   d          )NzLocale z( does not support list formatting style z (supported are ))_style_fallbacksgetlist_patterns
ValueErrorsorted)r   r   s     r   r)   r)   }   s    <+//r::<< / /F((('.... )
	:& 	: 	:% 	: 	: !566	: 	: 	:  r   )r   N)r   r   r   r   r   r   r   r   )r   r   r   r   )__doc__
__future__r   r   collections.abcr   typingr   
babel.corer   r   r   r   r.   r6   r)    r   r   <module>rA      s    # " " " " "  $ $ $ $ $ $       - - - - - - - - .""K K K ku"&B B B B BZ d#(*5!l:&555,       r   