
    h                     !   S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	  SSK
Jr  SSK
Jr  SSKJr  SSKJr  SS	KJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJr  S
SKJ r   S
SKJ!r!  \RD                  (       a1  SSK#r$S
SK%J&r&  S
SK'J(r(  S
SKJ)r)  S
SK*J+r+   " S S\$RX                  5      r-\R\                  " S\R^                  S\R`                  4   S 9r1\R\                  " S!5      r2\R\                  " S"5      r3S#\3S$\34S% jr4  SS&S'S(\Rj                  \Rl                  \7\84      S)\Rj                  \R^                  \R`                  /\R`                  4      S*\Rj                  \R`                     S$\R^                  \R`                  /\R`                  4   4
S+ jjr9 SS&S'S(\Rj                  \Rl                  \7\84      S)\Rj                  \R^                  \R`                  /\R`                  4      S$\R^                  \R`                  /\Rt                  \R`                     4   4S, jjr;S-\Rj                  \Rl                  \7\84      S$\Rt                  \Rl                  \7\84      4S. jr<S#S/S$\4S0 jr=S#\Rl                  \7\R|                  \7\R`                  4   \R~                  \R                  \7\R`                  4      4   S$\74S1 jrA\ SS2S3S4\7S5\7S6\7S7\Rj                  \8   S$\74S8 jj5       rBS4\7S$\74S9 jrCS4\7S$\74S: jrDS#\Rl                  \R|                  \2\34   \4   S$\R                  \R                  \2\34      4S; jrF\R                  " S<\R                  S=9rI\ SS2S3S>\R|                  \7\R`                  4   S?\JS$\74S@ jj5       rKS4\7S$\74SA jrL\R                  " SB5      rMS4\7S$\74SC jrN   SS#\R|                  \2\34   SD\JSESFSG\JS$\Rt                  \R                  \2\34      4
SH jjrO\   SS&S'S#SISG\JSD\JS(\Rj                  \Rl                  \7\84      S$SJ4SK jj5       rP\  SS&S'S#SISD\JS(\Rj                  \Rl                  \7\84      S$SL4
SM jj5       rQ\" \Q5        SS&S'S#SNSD\JS(\Rj                  \Rl                  \7\84      S$SL4
SO jj5       rRS&S'S#SISPSQSD\JS(\Rj                  \Rl                  \7\84      S$SR4SS jrS\  SS&S'S#SISD\JS(\Rj                  \Rl                  \7\84      S$SR4
ST jj5       rT\  SS&S'S#SISD\JS(\Rj                  \Rl                  \7\84      S$SR4
SU jj5       rU  SS#\3SV\3SW\JS$\34SX jjrV\  SS2S3S#\R~                  \R`                     S>\7S(\Rj                  \Rl                  \7\84      S$\74
SY jj5       rW\" \W5        SS2S3S#\Rl                  \R                  \R`                     \R~                  \R`                     4   S>\7S(\Rj                  \Rl                  \7\84      S$\74
SZ jj5       rYSS#\7S[\8S$\74S\ jjrZ\      SS] j5       r[\" \[5            SS^ j5       r\\      SS_ j5       r]\SSb j5       r^SS#\Rl                  \7\_\84   Sc\JS$\74Sd jjr`S#\R`                  S$\74Se jra\R                  " Sf5      rb\     SS2S3S#\7Sg\Rj                  \8   Sh\JSi\Rj                  \7   Sj\Rj                  \7   Sk\Rj                  \R~                  \7      S$\74Sl jj5       rc SS4\7S[\Rl                  \8\74   Sm\JSn\JS$\74
So jjrd\    SSpS'S4\7Sq\8Sr\JSs\7St\Rj                  \8   S$\74Su jj5       re\    SS&S'S4\7S[\8Sv\JSw\Rj                  \7   Sx\JS$\74Sy jj5       rf\R                  " Sz5      rgS4\7S$\84S{ jrhSS#\R`                  S*\8S|\8S$\84S} jjriSS#\R`                  S*\_S$\_4S~ jjrjS#\7S\R`                  S\R`                  S$\74S jrkSS#\7S\Rj                  \7   S$\74S jjrlS#S/S$\74S jrm SS#SS\8SSS$S4S jjrn\" \n5       SS#SNS\8S\Rj                  \R`                     S$S4S jj5       ro SS#SIS\8SSS$S4S jjrp  SS#\_S\8SSS$\_4S jjrq " S S\R                  5      rs\  SS&S'S#SIS(\Rl                  \7\84   S*\Rj                  \R`                     SD\JS$S4S jj5       rt\" \t5        SS&S'S#SNS(\Rl                  \7\84   S*\Rj                  \R`                     SD\JS$S4S jj5       ru\  SS&S'SSIS(\Rj                  \Rl                  \7\84      S\3S$\34
S jj5       rv\" \v5        SS&S'SSNS(\Rj                  \Rl                  \7\84      S\3S$\34
S jj5       rwGS S jrx\" \x5      GSS j5       ryS#\7S$\4S jrzS#\7S$\74S jr{\R                  S#\7S$\74S j5       r}\R                  GSS j5       r}S#\Rl                  \7\R~                  \3   4   S$\Rl                  \7\R~                  \3   4   4S jr}\S&S'S\R`                  S\7S$\Rl                  \\R`                  4   4S j5       r~\R                  S`SaS#\R~                  \R`                     S\7S\R`                  S\R`                  S$\R~                  \R`                     4S j5       r\R                  SSS.S`SaS#\R~                  \R`                     S(\7S*\Rj                  \R`                     S$\R~                  \R`                     4
S jj5       r\S`SaS#\R~                  \R`                     S\R`                  S\R`                  S$\R~                  \R`                     4
S j5       r\R                  S`SaS#\Rl                  \R                  \R`                     \R~                  \R`                     4   S\7S\R`                  S\R`                  S$\R~                  \R`                     4S j5       r\R                  SSS.S`SaS#\Rl                  \R                  \R`                     \R~                  \R`                     4   S(\7S*\Rj                  \R`                     S$\R~                  \R`                     4
S jj5       r\" \5      S`SaS#\Rl                  \R                  \R`                     \R~                  \R`                     4   S\R`                  S\R`                  S$\R                  \R`                     4
S j5       r\S`SaS#SIS\R`                  S\R`                  S$SL4
S j5       r\" \5      S`SaS#SNS\R`                  S\R`                  S$S4
S j5       r\S`SaS#SIS\R`                  S\R`                  S$SL4
S j5       r\" \5      S`SaS#SNS\R`                  S\R`                  S$S4
S j5       r\S`SaS#SIS\R`                  S\R`                  S$SL4
S j5       r\" \5      S`SaS#SNS\R`                  S\R`                  S$S4
S j5       r\S`SaS#SIS\R`                  S\R`                  S$SL4
S j5       r\" \5      S`SaS#SNS\R`                  S\R`                  S$S4
S j5       r\ SS2S3S#\R`                  S\Rj                  \8   S$\4S jj5       rS`SaS\R                  \R`                  S4   S\GR                  \7\R`                  4   S$\R^                  \R`                  /\R`                  4   4S jrS`SaS\R                  \R`                  S4   S\GR                  \7\R`                  4   S\R^                  \R`                  /\R`                  4   S\JS$\R^                  \R`                  /\R`                  4   4S jrS`SaS#SIS\R                  \R`                  S4   S\GR                  \7\R`                  4   S\R^                  \R`                  /\R`                  4   S\JS$SL4S jrS`SaS#SNS\R                  \R`                  S4   S\GR                  \7\R`                  4   S\R^                  \R`                  /\R`                  4   S\JS$S4S jr0 S\_S-\~_S\p_S\L_S\Z_S7\_S>\V_S*\V_S\O_S\_S\_S\`_Sm\\_S\j_S\=_S\k_S\u_0 S\d_S\i_S\Y_S\]_Sq\_S\y_S\D_S\F_S\_S\T_S\U_S\a_S\^_S\_S\_S\B_SG\}_E0 S\q_S\z_S\_S\_S\o_S\P_S\_S\m_S\w_S\N_S\l_S\e_S\R_S\C_S\A_S\c_S\h_E\f\K\S.Erg(  z7Built-in template filters used with the ``|`` operator.    N)abc)getattr_static)chain)groupby)escapeMarkup)soft_str   )async_variant)
auto_aiter)
auto_awaitauto_to_list)FilterArgumentError)	Undefined)htmlsafe_json_dumps)pass_context)pass_environment)pass_eval_contextpformat	url_quote)urlize)Environment)EvalContext)Context)SandboxedEnvironmentc                   "    \ rS rSrS\4S jrSrg)HasHTML'   returnc                     g N selfs    cC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\jinja2/filters.py__html__HasHTML.__html__(   s        r&   N)__name__
__module____qualname____firstlineno__strr*   __static_attributes__r&   r,   r)   r!   r!   '   s    	c 	r,   r!   F.)boundKVvaluer#   c                     [        U [        5      (       a)  [        R                  " [        U R                  5       5      $ U $ )ztFor use as a postprocessor for :func:`make_attrgetter`. Converts strings
to lowercase and returns other types as-is.)
isinstancer1   tcastr6   lowerr7   s    r)   ignore_caser>   1   s-     %vva''Lr,   environmentr   	attributepostprocessdefaultc                 z   ^ ^^^ [        U5      mS[        R                  S[        R                  4UU UU4S jjnU$ )zReturns a callable that looks up the given attribute from a
passed object with the rules of the environment.  Dots are allowed
to access attributes of attributes.  Integer parts in paths are
looked up as integers.
itemr#   c                    > T H2  nTR                  X5      n Tc  M  [        U [        5      (       d  M0  Tn M4     Tb  T" U 5      n U $ r%   )getitemr9   r   )rD   partrB   r?   partsrA   s     r)   
attrgetter#make_attrgetter.<locals>.attrgetterG   sK    D&&t2D"z$	'B'B	  "t$Dr,   )_prepare_attribute_partsr:   Any)r?   r@   rA   rB   rI   rH   s   ` `` @r)   make_attrgetterrM   :   s7     %Y/E
 
155 
 
 r,   c                   ^ ^^ [        U[        5      (       a  UR                  S5      nOU/nU Vs/ s H  n[        U5      PM     snmS[        R
                  S[        R                  [        R
                     4U UU4S jjnU$ s  snf )a  Returns a callable that looks up the given comma separated
attributes from a passed object with the rules of the environment.
Dots are allowed to access attributes of each attribute.  Integer
parts in paths are looked up as integers.

The value returned by the returned callable is a list of extracted
attribute values.

Examples of attribute: "attr1,attr2", "attr1.inner1.0,attr2.inner2.0", etc.
,rD   r#   c                    > S /[        T5      -  n[        T5       H0  u  p#U nU H  nTR                  XE5      nM     Tb  T" U5      nXAU'   M2     U$ r%   )len	enumeraterF   )	rD   itemsiattribute_partitem_irG   r?   rH   rA   s	         r)   rI   )make_multi_attrgetter.<locals>.attrgetterl   sd    U#!*5!1AF&$,,V: ' &$V,!H "2 r,   )r9   r1   splitrK   r:   rL   List)r?   r@   rA   rX   rD   rI   rH   s   ` `   @r)   make_multi_attrgetterrZ   V   sv     )S!!5>__S5I8=>%d+>E 166!%%=    % ?s   Battrc                     U c  / $ [        U [        5      (       aA  U R                  S5       Vs/ s H$  oR                  5       (       a  [	        U5      OUPM&     sn$ U /$ s  snf )N.)r9   r1   rX   isdigitint)r[   xs     r)   rK   rK      sV     |	$6:jjoFo))++A1,oFF6M Gs   +Azt.Union[str, HasHTML]c                     [        U S5      (       a%  [        R                  " SU 5      R                  5       n [	        [        U 5      5      $ )zCEnforce HTML escaping.  This will probably double escape variables.r*   r!   )hasattrr:   r;   r*   r   r1   r=   s    r)   do_forceescaperc      s7    uj!!y%(113#e*r,   c                     [        U [        5      (       d  [        U [        R                  5      (       d  [	        U 5      $ [        U [
        5      (       a  U R                  5       nOU nSR                  S U 5       5      $ )a  Quote data for use in a URL path or query using UTF-8.

Basic wrapper around :func:`urllib.parse.quote` when given a
string, or :func:`urllib.parse.urlencode` for a dict or iterable.

:param value: Data to quote. A string will be quoted directly. A
    dict or iterable of ``(key, value)`` pairs will be joined as a
    query string.

When given a string, "/" is not quoted. HTTP servers treat "/" and
"%2F" equivalently in paths. If you need quoted slashes, use the
``|replace("/", "%2F")`` filter.

.. versionadded:: 2.7
&c              3   T   #    U  H  u  p[        US S9 S[        US S9 3v   M      g7f)T)for_qs=Nr   ).0kvs      r)   	<genexpr>do_urlencode.<locals>.<genexpr>   s0      OTtq9Qt$
%Qy4'@&ABus   &()r9   r1   r   Iterabler   dictrS   join)r7   rS   s     r)   do_urlencoderq      sg    $ %Zs||%D%D%1688 OT  r,   eval_ctxr   soldnewcountc                 h   Uc  SnU R                   (       d.  [        U5      R                  [        U5      [        U5      U5      $ [        US5      (       d"  [        US5      (       a  [        US5      (       d  [	        U5      nO[        U5      nUR                  [        U5      [        U5      U5      $ )a  Return a copy of the value with all occurrences of a substring
replaced with a new one. The first argument is the substring
that should be replaced, the second is the replacement string.
If the optional third argument ``count`` is given, only the first
``count`` occurrences are replaced:

.. sourcecode:: jinja

    {{ "Hello World"|replace("Hello", "Goodbye") }}
        -> Goodbye World

    {{ "aaaaargh"|replace("a", "d'oh, ", 2) }}
        -> d'oh, d'oh, aaargh
r*   )
autoescaper1   replacerb   r   r
   )rr   rs   rt   ru   rv   s        r)   
do_replacer{      s    $ }1v~~c#hC%88 	Z  3
##:&&1IQK99Xc]HSM599r,   c                 4    [        U 5      R                  5       $ )zConvert a value to uppercase.)r
   upperrs   s    r)   do_upperr          A;r,   c                 4    [        U 5      R                  5       $ )zConvert a value to lowercase.)r
   r<   r~   s    r)   do_lowerr      r   r,   c              #      #    [        U [        5      (       a  g[        U [        R                  5      (       d  [	        S5      eU R                  5        Sh  vN   g N7f)a  Return an iterator over the ``(key, value)`` items of a mapping.

``x|items`` is the same as ``x.items()``, except if ``x`` is
undefined an empty iterator is returned.

This filter is useful if you expect the template to be rendered with
an implementation of Jinja in another programming language that does
not have a ``.items()`` method on its mapping type.

.. code-block:: html+jinja

    <dl>
    {% for key, value in my_dict|items %}
        <dt>{{ key }}
        <dd>{{ value }}
    {% endfor %}
    </dl>

.. versionadded:: 3.1
Nz'Can only get item pairs from a mapping.)r9   r   r   Mapping	TypeErrorrS   r=   s    r)   do_itemsr      sC     * %##eS[[))ABB{{}s   AAAAz[\s/>=])flagsd	autospacec                    / nUR                  5        Hm  u  pEUb  [        U[        5      (       a  M  [        R	                  U5      b  [        SU< 35      eUR                  [        U5       S[        U5       S35        Mo     SR                  U5      nU(       a  U(       a  SU-   nU R                  (       a  [        U5      nU$ )a9  Create an SGML/XML attribute string based on the items in a dict.

**Values** that are neither ``none`` nor ``undefined`` are automatically
escaped, safely allowing untrusted user input.

User input should not be used as **keys** to this filter. If any key
contains a space, ``/`` solidus, ``>`` greater-than sign, or ``=`` equals
sign, this fails with a ``ValueError``. Regardless of this, user input
should never be used as keys to this filter, or must be separately validated
first.

.. sourcecode:: html+jinja

    <ul{{ {'class': 'my_list', 'missing': none,
            'id': 'list-%d'|format(variable)}|xmlattr }}>
    ...
    </ul>

Results in something like this:

.. sourcecode:: html

    <ul class="my_list" id="list-42">
    ...
    </ul>

As you can see it automatically prepends a space in front of the item
if the filter returned something unless the second parameter is false.

.. versionchanged:: 3.1.4
    Keys with ``/`` solidus, ``>`` greater-than sign, or ``=`` equals sign
    are not allowed.

.. versionchanged:: 3.1.3
    Keys with spaces are not allowed.
z%Invalid character in attribute name: z="" )rS   r9   r   _attr_key_research
ValueErrorappendr   rp   ry   r	   )rr   r   r   rS   keyr7   rvs          r)   
do_xmlattrr     s    P Eggi
=Jui88s#/DSGLMMs}Bve}oQ78   
%BR2XBZIr,   c                 4    [        U 5      R                  5       $ )zQCapitalize a value. The first character will be uppercase, all others
lowercase.
)r
   
capitalizer~   s    r)   do_capitalizer   A  s     A;!!##r,   z([-\s({\[<]+)c           	          SR                  [        R                  [        U 5      5       Vs/ s H3  nU(       d  M  US   R	                  5       USS R                  5       -   PM5     sn5      $ s  snf )zReturn a titlecased version of the value. I.e. words will start with
uppercase letters, all remaining characters are lowercase.
 r   r   N)rp   _word_beginning_split_rerX   r
   r}   r<   )rs   rD   s     r)   do_titler   K  sg     77 166x{C	
C /DGMMOd12hnn..C	
 	
s
   A-+A-case_sensitivebyzte.Literal["key", "value"]reversec                   ^^ US:X  a  SmOUS:X  a  SmO[        S5      eS[        R                  [        R                  [        R                  4   S[        R                  4UU4S jjn[	        U R                  5       XCS	9$ )
a:  Sort a dict and yield (key, value) pairs. Python dicts may not
be in the order you want to display them in, so sort them first.

.. sourcecode:: jinja

    {% for key, value in mydict|dictsort %}
        sort the dict by key, case insensitive

    {% for key, value in mydict|dictsort(reverse=true) %}
        sort the dict by key, case insensitive, reverse order

    {% for key, value in mydict|dictsort(true) %}
        sort the dict by key, case sensitive

    {% for key, value in mydict|dictsort(false, 'value') %}
        sort the dict by value, case insensitive
r   r   r7   r   z,You can only sort by either "key" or "value"rD   r#   c                 6   > U T   nT(       d  [        U5      nU$ r%   )r>   )rD   r7   r   poss     r)   	sort_funcdo_dictsort.<locals>.sort_funcv  s    S	&Er,   r   r   )r   r:   TuplerL   sortedrS   )r7   r   r   r   r   r   s    `   @r)   do_dictsortr   X  so    . 
U{	w!"PQQquu- !%%   %++-Y@@r,   t.Iterable[V]	t.List[V]c                 D    [        XU(       d  [        OSS9n[        XUS9$ )a  Sort an iterable using Python's :func:`sorted`.

.. sourcecode:: jinja

    {% for city in cities|sort %}
        ...
    {% endfor %}

:param reverse: Sort descending instead of ascending.
:param case_sensitive: When sorting strings, sort upper and lower
    case separately.
:param attribute: When sorting objects or dicts, an attribute or
    key to sort by. Can use dot notation like ``"address.city"``.
    Can be a list of attributes like ``"age,name"``.

The sort is stable, it does not change the relative order of
elements that compare equal. This makes it is possible to chain
sorts on different attributes and ordering.

.. sourcecode:: jinja

    {% for user in users|sort(attribute="name")
        |sort(reverse=true, attribute="age") %}
        ...
    {% endfor %}

As a shortcut to chaining when the direction is the same for all
attributes, pass a comma separate list of attributes.

.. sourcecode:: jinja

    {% for user in users|sort(attribute="age,name") %}
        ...
    {% endfor %}

.. versionchanged:: 2.11.0
    The ``attribute`` parameter can be a comma separated list of
    attributes, e.g. ``"age,name"``.

.. versionchanged:: 2.6
   The ``attribute`` parameter was added.
NrA   r   )rZ   r>   r   )r?   r7   r   r   r@   key_funcs         r)   do_sortr     s(    d %~KSWH %w77r,   zt.Iterator[V]c              #      #    [        XU(       d  [        OSS9n[        5       nU H'  nU" U5      nXu;  d  M  UR                  U5        Uv   M)     g7f)a  Returns a list of unique items from the given iterable.

.. sourcecode:: jinja

    {{ ['foo', 'bar', 'foobar', 'FooBar']|unique|list }}
        -> ['foo', 'bar', 'foobar']

The unique items are yielded in the same order as their first occurrence in
the iterable passed to the filter.

:param case_sensitive: Treat upper and lower case strings as distinct.
:param attribute: Filter objects with unique values for this attribute.
Nr   )rM   r>   setadd)r?   r7   r   r@   getterseenrD   r   s           r)   sync_do_uniquer     sL     ( ~KSWF 5DTl?HHSMJ s
   2AA*t.Union[t.AsyncIterable[V], t.Iterable[V]]c                 J   #    [        U [        U5      I S h  vN X#5      $  N	7fr%   )r   r   r?   r7   r   r@   s       r)   	do_uniquer     s&      <.. .   #!

#funczt.Callable[..., V]t.Union[V, Undefined]c                     [        U5      n [        U5      n[	        XU(       d  [
        OS S9nU" [        U/U5      US9$ ! [         a    U R                  S5      s $ f = f)Nz'No aggregated item, sequence was empty.r   r   )iternextStopIteration	undefinedrM   r>   r   )r?   r7   r   r   r@   itfirstr   s           r)   _min_or_maxr     so     
eBPR ~KSWH ugr"11  P$$%NOOPs   A AAc                 $    [        X[        X#5      $ )zReturn the smallest item from the sequence.

.. sourcecode:: jinja

    {{ [1, 2, 3]|min }}
        -> 1

:param case_sensitive: Treat upper and lower case strings as distinct.
:param attribute: Get the object with the min value of this attribute.
)r   minr   s       r)   do_minr         " {3JJr,   c                 $    [        X[        X#5      $ )zReturn the largest item from the sequence.

.. sourcecode:: jinja

    {{ [1, 2, 3]|max }}
        -> 3

:param case_sensitive: Treat upper and lower case strings as distinct.
:param attribute: Get the object with the max value of this attribute.
)r   maxr   s       r)   do_maxr     r   r,   default_valuebooleanc                 P    [        U [        5      (       d  U(       a	  U (       d  U$ U $ )a$  If the value is undefined it will return the passed default value,
otherwise the value of the variable:

.. sourcecode:: jinja

    {{ my_variable|default('my_variable is not defined') }}

This will output the value of ``my_variable`` if the variable was
defined, otherwise ``'my_variable is not defined'``. If you want
to use default with variables that evaluate to false you have to
set the second parameter to `true`:

.. sourcecode:: jinja

    {{ ''|default('the string was empty', true) }}

.. versionchanged:: 2.11
   It's now possible to configure the :class:`~jinja2.Environment` with
   :class:`~jinja2.ChainableUndefined` to make the `default` filter work
   on nested elements and attributes that may contain undefined values
   in the chain without getting an :exc:`~jinja2.UndefinedError`.
)r9   r   )r7   r   r   s      r)   
do_defaultr   "  s     6 %##Lr,   c                    Ub   [        [        U R                  U5      U5      nU R                  (       d(  [	        U5      R                  [        [        U5      5      $ [        US5      (       dr  [        U5      nSn[        U5       H'  u  pV[        US5      (       a  SnM  [	        U5      X'   M)     U(       a  [        U5      nO[	        U5      nUR                  U5      $ [        U5      R                  [        [        U5      5      $ )a  Return a string which is the concatenation of the strings in the
sequence. The separator between elements is an empty string per
default, you can define it with the optional parameter:

.. sourcecode:: jinja

    {{ [1, 2, 3]|join('|') }}
        -> 1|2|3

    {{ [1, 2, 3]|join }}
        -> 123

It is also possible to join certain attributes of an object:

.. sourcecode:: jinja

    {{ users|join(', ', attribute='username') }}

.. versionadded:: 2.6
   The `attribute` parameter was added.
r*   FT)maprM   r?   ry   r1   rp   rb   listrR   r   r
   )rr   r7   r   r@   	do_escapeidxrD   s          r)   sync_do_joinr   C  s    8 OH$8$8)DeL 1v{{3sE?++ 1j!!U	"5)ICtZ(( 	 Y
	 * q	AAAvve} A;C%011r,   c                 J   #    [        U [        U5      I S h  vN X#5      $  N	7fr%   )r   r   )rr   r7   r   r@   s       r)   do_joinr   }  s!      U(;";QJJ";r   widthc                 6    [        U 5      R                  U5      $ )z.Centers the value in a field of a given width.)r
   center)r7   r   s     r)   	do_centerr     s    E?!!%((r,   c                 n     [        [        U5      5      $ ! [         a    U R                  S5      s $ f = f)z$Return the first item of a sequence."No first item, sequence was empty.)r   r   r   r   r?   seqs     r)   sync_do_firstr     s9    
KDI K$$%IJJKs    44c                    #     [        U5      R                  5       I S h  vN $  N! [         a    U R                  S5      s $ f = f7f)Nr   )r   	__anext__StopAsyncIterationr   r   s     r)   do_firstr     sF     K_..0000 K$$%IJJKs1   A' %' A' AAAAc                      [        [        [        U5      5      5      $ ! [         a    U R	                  S5      s $ f = f)zReturn the last item of a sequence.

Note: Does not work with generators. You may want to explicitly
convert it to a list:

.. sourcecode:: jinja

    {{ data | selectattr('name', '==', 'Jinja') | list | last }}
z!No last item, sequence was empty.)r   r   reversedr   r   r   s     r)   do_lastr     s?    JD#'(( J$$%HIIJs    ==contextr   c                      [         R                  " U5      $ ! [         a    U R                  R	                  S5      s $ f = f)z'Return a random item from the sequence.z#No random item, sequence was empty.)randomchoice
IndexErrorr?   r   )r   r   s     r)   	do_randomr     s@    T}}S!! T"",,-RSSTs    %A A binaryc                 ~   [        U 5      nU(       a  SOSnU(       a  SOSU(       a  SOSU(       a  SOSU(       a  S	OS
U(       a  SOSU(       a  SOSU(       a  SOSU(       a  SOS/nUS:X  a  gX#:  a  [        U5       S3$ [        U5       H   u  pVX5S-   -  nX':  d  M  X2-  U-  S SU 3s  $    X2-  W-  S SW 3$ )zFormat the value like a 'human-readable' file size (i.e. 13 kB,
4.1 MB, 102 Bytes, etc).  Per default decimal prefixes are used (Mega,
Giga, etc.), if the second parameter is set to `True` the binary
prefixes are used (Mebi, Gibi).
i   i  KiBkBMiBMBGiBGBTiBTBPiBPBEiBEBZiBZBYiBYBr   z1 Bytez Bytes   z.1fr   )floatr_   rR   )r7   r   bytesbaseprefixesrT   prefixunits           r)   do_filesizeformatr    s     %LE4tDdddddddd	H z	e*V$$"8,IAE?D|,-c2!F8<<	 - ,%c*!F844r,   c                     [        U 5      $ )z.Pretty print a variable. Useful for debugging.r   r=   s    r)   	do_pprintr    s    5>r,   z^([\w.+-]{2,}:(/){0,2})$trim_url_limitnofollowtargetrelextra_schemesc                 "   U R                   R                  n[        U=(       d    SR                  5       5      nU(       a  UR	                  S5        UR                  US   =(       d    SR                  5       5        SR                  [        U5      5      =(       d    SnUc  US   nUc  US   =(       d    SnU H(  n	[        R                  U	5      b  M  [        U	< S	35      e   [        UUUUUS
9n
U R                  (       a  [        U
5      n
U
$ )a  Convert URLs in text into clickable links.

This may not recognize links in some situations. Usually, a more
comprehensive formatter, such as a Markdown library, is a better
choice.

Works on ``http://``, ``https://``, ``www.``, ``mailto:``, and email
addresses. Links with trailing punctuation (periods, commas, closing
parentheses) and leading punctuation (opening parentheses) are
recognized excluding the punctuation. Email addresses that include
header fields are not recognized (for example,
``mailto:address@example.com?cc=copy@example.com``).

:param value: Original text containing URLs to link.
:param trim_url_limit: Shorten displayed URL values to this length.
:param nofollow: Add the ``rel=nofollow`` attribute to links.
:param target: Add the ``target`` attribute to links.
:param rel: Add the ``rel`` attribute to links.
:param extra_schemes: Recognize URLs that start with these schemes
    in addition to the default behavior. Defaults to
    ``env.policies["urlize.extra_schemes"]``, which defaults to no
    extra schemes.

.. versionchanged:: 3.0
    The ``extra_schemes`` parameter was added.

.. versionchanged:: 3.0
    Generate ``https://`` links for URLs without a scheme.

.. versionchanged:: 3.0
    The parsing rules were updated. Recognize email addresses with
    or without the ``mailto:`` scheme. Validate IP addresses. Ignore
    parentheses and brackets in more cases.

.. versionchanged:: 2.8
   The ``target`` parameter was added.
r   r	  z
urlize.relr   Nzurlize.targetzurlize.extra_schemesr&   z" is not a valid URI scheme prefix.)r  r  r
  r  )r?   policiesr   rX   r   updaterp   r   _uri_scheme_re	fullmatchr   r   ry   r	   )rr   r7   r  r	  r
  r  r  r  	rel_partsschemer   s              r)   	do_urlizer    s    ^ ##,,HSYB%%'(Ij!h|,299;<
((6)$
%
-C~/* !78>B##F+3%
2T&UVV   
%#
B BZIr,   r   blankc                   ^ [        U[        5      (       a  UmOSU-  mSn[        U [        5      (       a  [        T5      m[        U5      nX-  n U(       a#  UT-   R                  U R	                  5       5      nOHU R	                  5       nUR                  S5      nU(       a   XTUR                  U4S jU 5       5      -   -  nU(       a  TU-   nU$ )a  Return a copy of the string with each line indented by 4 spaces. The
first line and blank lines are not indented by default.

:param width: Number of spaces, or a string, to indent by.
:param first: Don't skip indenting the first line.
:param blank: Don't skip indenting empty lines.

.. versionchanged:: 3.0
    ``width`` can be a string.

.. versionchanged:: 2.10
    Blank lines are not indented by default.

    Rename the ``indentfirst`` argument to ``first``.
r   
r   c              3   >   >#    U  H  o(       a  TU-   OUv   M     g 7fr%   r&   )ri   line	indentions     r)   rl   do_indent.<locals>.<genexpr>_  s       )?DtD	D d2us   )r9   r1   r	   rp   
splitlinespop)rs   r   r   r  newliner   linesr  s          @r)   	do_indentr   9  s    $ %	%K	G!V9%	/LA	!''7YYq\GLL )?D)   B ^Ir,   envlength	killwordsendleewayc                 <   Uc  U R                   S   nU[        U5      :  d   S[        U5       SU 35       eUS:  d
   SU 35       e[        U5      X%-   ::  a  U$ U(       a  USU[        U5      -
   U-   $ USU[        U5      -
   R                  SS5      S   nXd-   $ )	a  Return a truncated copy of the string. The length is specified
with the first parameter which defaults to ``255``. If the second
parameter is ``true`` the filter will cut the text at length. Otherwise
it will discard the last word. If the text was in fact
truncated it will append an ellipsis sign (``"..."``). If you want a
different ellipsis sign than ``"..."`` you can specify it using the
third parameter. Strings that only exceed the length by the tolerance
margin given in the fourth parameter will not be truncated.

.. sourcecode:: jinja

    {{ "foo bar baz qux"|truncate(9) }}
        -> "foo..."
    {{ "foo bar baz qux"|truncate(9, True) }}
        -> "foo ba..."
    {{ "foo bar baz qux"|truncate(11) }}
        -> "foo bar baz qux"
    {{ "foo bar baz qux"|truncate(11, False, '...', 0) }}
        -> "foo bar..."

The default leeway on newer Jinja versions is 5 and was 0 before but
can be reconfigured globally.
Nztruncate.leewayzexpected length >= z, got r   zexpected leeway >= 0, got r   r   )r  rQ   rsplit)r!  rs   r"  r#  r$  r%  results          r)   do_truncater)  i  s    @ ~/0SXM!4SXJfVHMMQ;=4VH==;
1v $6CH$%++"#c("#**3215F<r,   break_long_words
wrapstringbreak_on_hyphensc                     SSK nUc  U R                  nUR                  UR                  5        Vs/ s H&  nUR                  UR	                  UUSSUUS95      PM(     sn5      $ s  snf )a  Wrap a string to the given width. Existing newlines are treated
as paragraphs to be wrapped separately.

:param s: Original text to wrap.
:param width: Maximum length of wrapped lines.
:param break_long_words: If a word is longer than ``width``, break
    it across lines.
:param break_on_hyphens: If a word contains hyphens, it may be split
    across lines.
:param wrapstring: String to join each wrapped line. Defaults to
    :attr:`Environment.newline_sequence`.

.. versionchanged:: 2.11
    Existing newlines are treated as paragraphs wrapped separately.

.. versionchanged:: 2.11
    Added the ``break_on_hyphens`` parameter.

.. versionchanged:: 2.7
    Added the ``wrapstring`` parameter.
r   NF)r   expand_tabsreplace_whitespacer*  r,  )textwrapnewline_sequencerp   r  wrap)r?   rs   r   r*  r+  r,  r0  r  s           r)   do_wordwrapr3    s    <  11
 ?? 	
 ' OO %',%5%5  	 '	
 	
s   -A%z\w+c                 P    [        [        R                  [        U 5      5      5      $ )zCount the words in that string.)rQ   _word_refindallr
   r~   s    r)   do_wordcountr7    s    x,--r,   r  c                      [        U [        5      (       a  [        X5      $ [        U 5      $ ! [        [        4 a7     [        [        U 5      5      s $ ! [        [        [        4 a    Us s $ f = ff = f)aq  Convert the value into an integer. If the
conversion doesn't work it will return ``0``. You can
override this default using the first parameter. You
can also override the default base (10) in the second
parameter, which handles input with prefixes such as
0b, 0o and 0x for bases 2, 8 and 16 respectively.
The base is ignored for decimal numbers and non-string values.
)r9   r1   r_   r   r   r   OverflowError)r7   rB   r  s      r)   do_intr:    sl    
eS!!u##5zz" 	uU|$$:}5 	N		s0   - 
- A4AA4A0+A4/A00A4c                 J     [        U 5      $ ! [        [        4 a    Us $ f = f)zConvert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter.
)r   r   r   )r7   rB   s     r)   do_floatr<    s*    
U|z" s   
 ""argskwargsc                 b    U(       a  U(       a  [        S5      e[        U 5      U=(       d    U-  $ )a  Apply the given values to a `printf-style`_ format string, like
``string % values``.

.. sourcecode:: jinja

    {{ "%s, %s!"|format(greeting, name) }}
    Hello, World!

In most cases it should be more convenient and efficient to use the
``%`` operator or :meth:`str.format`.

.. code-block:: text

    {{ "%s, %s!" % (greeting, name) }}
    {{ "{}, {}!".format(greeting, name) }}

.. _printf-style: https://docs.python.org/library/stdtypes.html
    #printf-style-string-formatting
z>can't handle positional and keyword arguments at the same time)r   r
   )r7   r=  r>  s      r)   	do_formatr@    s.    ( !L
 	
 E?fn--r,   charsc                 6    [        U 5      R                  U5      $ )z=Strip leading and trailing characters, by default whitespace.)r
   strip)r7   rA  s     r)   do_trimrD    s    E?  ''r,   c                     [        U S5      (       a%  [        R                  " SU 5      R                  5       n [	        [        U 5      5      R                  5       $ )zAStrip SGML/XML tags and replace adjacent whitespace by one space.r*   r!   )rb   r:   r;   r*   r	   r1   	striptagsr=   s    r)   do_striptagsrG    s@    uj!!y%(113#e*''))r,   zt.Collection[V]slices	fill_withzt.Optional[V]zt.Iterator[t.List[V]]c              #      #    [        U 5      n[        U5      nXA-  nXA-  nSn[        U5       H?  nXxU-  -   n	X:  a  US-  nXxS-   U-  -   n
X9U
 nUb  X:  a  UR                  U5        Uv   MA     g7f)a
  Slice an iterator and return a list of lists containing
those items. Useful if you want to create a div containing
three ul tags that represent columns:

.. sourcecode:: html+jinja

    <div class="columnwrapper">
      {%- for column in items|slice(3) %}
        <ul class="column-{{ loop.index }}">
        {%- for item in column %}
          <li>{{ item }}</li>
        {%- endfor %}
        </ul>
      {%- endfor %}
    </div>

If you pass it a second argument it's used to fill missing
values on the last iteration.
r   r   N)r   rQ   ranger   )r7   rH  rI  r   r"  items_per_sliceslices_with_extraoffsetslice_numberstartr$  tmps               r)   sync_do_slicerR  #  s     , u+CXF&OFf77+aKFq(O;;n \%FJJy!	 &s   A0A2c                 H   #    [        [        U 5      I S h  vN X5      $  N	7fr%   )rR  r   )r7   rH  rI  s      r)   do_slicerT  N  s      |E22FFF2s   " 
"	linecountc              #      #    / nU  H)  n[        U5      U:X  a  Uv   / nUR                  U5        M+     U(       a+  Ub#  [        U5      U:  a  X2/U[        U5      -
  -  -  nUv   gg7f)a  
A filter that batches items. It works pretty much like `slice`
just the other way round. It returns a list of lists with the
given number of items. If you provide a second parameter this
is used to fill up missing items. See this example:

.. sourcecode:: html+jinja

    <table>
    {%- for row in items|batch(3, '&nbsp;') %}
      <tr>
      {%- for column in row %}
        <td>{{ column }}</td>
      {%- endfor %}
      </tr>
    {%- endfor %}
    </table>
N)rQ   r   )r7   rU  rI  rQ  rD   s        r)   do_batchrW  W  sp     * Cs8y IC

4   SX	%9;)c#h"677C		 s   A%A'	precisionmethodz%te.Literal["common", "ceil", "floor"]c                     US;  a  [        S5      eUS:X  a  [        X5      $ [        [        U5      n[        R
                  " [        U" U SU-  -  5      SU-  -  5      $ )aH  Round the number to a given precision. The first
parameter specifies the precision (default is ``0``), the
second the rounding method:

- ``'common'`` rounds either up or down
- ``'ceil'`` always rounds up
- ``'floor'`` always rounds down

If you don't specify a method ``'common'`` is used.

.. sourcecode:: jinja

    {{ 42.55|round }}
        -> 43.0
    {{ 42.55|round(1, 'floor') }}
        -> 42.5

Note that even if rounded to 0 precision, a float is returned.  If
you need a real integer, pipe it through `int`:

.. sourcecode:: jinja

    {{ 42.55|round|int }}
        -> 43
>   ceilfloorcommonz$method must be common, ceil or floorr]  
   )r   roundgetattrmathr:   r;   r   )r7   rX  rY  r   s       r)   do_roundrb  |  s`    < 00!"HIIU&&4 D66%er9}56"i-HIIr,   c                       \ rS rSr% \R
                  \S'   \R                  \R
                     \S'   S\4S jr	S\4S jr
Srg)	_GroupTuplei  grouperr   r#   c                 ,    [         R                  U 5      $ r%   )tuple__repr__r'   s    r)   rh  _GroupTuple.__repr__  s    ~~d##r,   c                 ,    [         R                  U 5      $ r%   )rg  __str__r'   s    r)   rk  _GroupTuple.__str__  s    }}T""r,   r&   N)r-   r.   r/   r0   r:   rL   __annotations__rY   r1   rh  rk  r2   r&   r,   r)   rd  rd    s5    UUN
&&-$# $# #r,   rd  zt.List[_GroupTuple]c           
      8   [        U UU(       d  [        OSUS9n[        [        XS9U5       VVs/ s H  u  pg[	        U[        U5      5      PM     nnnU(       d3  [        XUS9n	U V
Vs/ s H  u  p[	        U	" US   5      U5      PM     nn
nU$ s  snnf s  snn
f )a  Group a sequence of objects by an attribute using Python's
:func:`itertools.groupby`. The attribute can use dot notation for
nested access, like ``"address.city"``. Unlike Python's ``groupby``,
the values are sorted first so only one group is returned for each
unique value.

For example, a list of ``User`` objects with a ``city`` attribute
can be rendered in groups. In this example, ``grouper`` refers to
the ``city`` value of the group.

.. sourcecode:: html+jinja

    <ul>{% for city, items in users|groupby("city") %}
      <li>{{ city }}
        <ul>{% for user in items %}
          <li>{{ user.name }}
        {% endfor %}</ul>
      </li>
    {% endfor %}</ul>

``groupby`` yields namedtuples of ``(grouper, list)``, which
can be used instead of the tuple unpacking above. ``grouper`` is the
value of the attribute, and ``list`` is the items with that value.

.. sourcecode:: html+jinja

    <ul>{% for group in users|groupby("city") %}
      <li>{{ group.grouper }}: {{ group.list|join(", ") }}
    {% endfor %}</ul>

You can specify a ``default`` value to use if an object in the list
does not have the given attribute.

.. sourcecode:: jinja

    <ul>{% for city, items in users|groupby("city", default="NY") %}
      <li>{{ city }}: {{ items|map(attribute="name")|join(", ") }}</li>
    {% endfor %}</ul>

Like the :func:`~jinja-filters.sort` filter, sorting and grouping is
case-insensitive by default. The ``key`` for each group will have
the case of the first item in that group of values. For example, if
a list of users has cities ``["CA", "NY", "ca"]``, the "CA" group
will have two values. This can be disabled by passing
``case_sensitive=True``.

.. versionchanged:: 3.1
    Added the ``case_sensitive`` parameter. Sorting and grouping is
    case-insensitive by default, matching other filters that do
    comparisons.

.. versionchanged:: 3.0
    Added the ``default`` parameter.

.. versionchanged:: 2.6
    The attribute supports dot notation for nested access.
NrA   rB   r   rB   r   )rM   r>   r   r   rd  r   r?   r7   r@   rB   r   exprr   valuesoutoutput_expr_s              r)   sync_do_groupbyrw    s    B '5K4	D #6%#:DAAKC 	Cf&A  
 %kgNLOPCyq{;vay16:CPJ Qs   !B*!Bc           
      |  #    [        U UU(       d  [        OS US9n[        [        [	        U5      I S h  vN US9U5       VVs/ s H"  u  pg[        U[	        U5      I S h  vN 5      PM$     nnnU(       d3  [        XUS9n	U V
Vs/ s H  u  p[        U	" US   5      U5      PM     nn
nU$  Nw NMs  snnf s  snn
f 7f)Nro  r   rp  r   )rM   r>   r   r   r   rd  rq  s              r)   
do_groupbyry    s      '5K4	D #6U0C*C#NPTUUKC 	C|F334U  
 %kgNLOPCyq{;vay16:CPJ +D 4 Qs?   2B<B,B<B0 B.!B0-B<!B6'B<.B00B<iterablerP  c                 H    Ub  [        [        X5      U5      n[        X5      $ )a  Returns the sum of a sequence of numbers plus the value of parameter
'start' (which defaults to 0).  When the sequence is empty it returns
start.

It is also possible to sum up only certain attributes:

.. sourcecode:: jinja

    Total: {{ items|sum(attribute='price') }}

.. versionchanged:: 2.6
   The ``attribute`` parameter was added to allow summing up over
   attributes.  Also the ``start`` parameter was moved on to the right.
)r   rM   sum)r?   rz  r@   rP  s       r)   sync_do_sumr}     s&    * {>Ixr,   c                    #    UnUb  [        X5      nOS[        S[        4S jn[        U5        S h  vN nXE" U5      -  nM   N
 U$ 7f)Nr`   r#   c                     U $ r%   r&   r`   s    r)   r   do_sum.<locals>.funcH      Hr,   )rM   r6   r   )r?   rz  r@   rP  r   r   rD   s          r)   do_sumr  ;  s]      
B{6	A 	! 	 !* d
d4j* Is%   .A
AAAA
AA
c                     [        U 5      $ )zcConvert the value into a list.  If it was a string the returned list
will be a list of characters.
)r   r=   s    r)   sync_do_listr  Q  s     ;r,   c                 4   #    [        U 5      I S h  vN $  N7fr%   r   r=   s    r)   do_listr  X  s     e$$$$s   c                     [        U 5      $ )z}Mark the value as safe which means that in an environment with automatic
escaping enabled this variable will not be escaped.
r   r=   s    r)   do_mark_safer  ]  s     %=r,   c                     [        U 5      $ )zHMark a value as unsafe.  This is the reverse operation for :func:`safe`.)r1   r=   s    r)   do_mark_unsafer  d  s    u:r,   c                     g r%   r&   r=   s    r)   
do_reverser  i  s    #&r,   c                     g r%   r&   r=   s    r)   r  r  m  s    ;>r,   c                     [        U [        5      (       a  U SSS2   $  [        U 5      $ ! [         a?     [	        U 5      nUR                  5         Us $ ! [         a  n[        S5      UeSnAff = ff = f)zTReverse the object or return an iterator that iterates over it the other
way round.
Nrx   zargument must be iterable)r9   r1   r   r   r   r   r   )r7   r   es      r)   r  r  q  s}     %TrT{J J	JeBJJLI 	J%&ABI	JJs,   
* 
A3AA3
A/A**A//A3objnamec                      [        X5        U R	                  X5      $ ! [         a$    [        X5      (       d  U R                  XS9s $  N>f = f)zGet an attribute of an object. ``foo|attr("bar")`` works like
``foo.bar``, but returns undefined instead of falling back to ``foo["bar"]``
if the attribute doesn't exist.

See :ref:`Notes on subscriptions <notes-on-subscriptions>` for more details.
)r  r  )r   AttributeErrorrb   r   r`  )r?   r  r  s      r)   do_attrr    sY    = 	s! s))  =s!!((S(<< "=s    )AAc                     g r%   r&   r   r7   r  r=  r>  s        r)   sync_do_mapr         r,   )r@   rB   c                    g r%   r&   r   r7   r@   rB   s       r)   r  r    r  r,   c              /   Z   #    U(       a   [        XU5      nU H  nU" U5      v   M     gg7f)a  Applies a filter on a sequence of objects or looks up an attribute.
This is useful when dealing with lists of objects but you are really
only interested in a certain value of it.

The basic usage is mapping on an attribute.  Imagine you have a list
of users but you are only interested in a list of usernames:

.. sourcecode:: jinja

    Users on this page: {{ users|map(attribute='username')|join(', ') }}

You can specify a ``default`` value to use if an object in the list
does not have the given attribute.

.. sourcecode:: jinja

    {{ users|map(attribute="username", default="Anonymous")|join(", ") }}

Alternatively you can let it invoke a filter by passing the name of the
filter and the arguments afterwards.  A good example would be applying a
text conversion filter on a sequence:

.. sourcecode:: jinja

    Users on this page: {{ titles|map('lower')|join(', ') }}

Similar to a generator comprehension such as:

.. code-block:: python

    (u.username for u in users)
    (getattr(u, "username", "Anonymous") for u in users)
    (do_lower(x) for x in titles)

.. versionchanged:: 2.11.0
    Added the ``default`` parameter.

.. versionadded:: 2.7
N)prepare_mapr   r7   r=  r>  r   rD   s         r)   r  r    s0     V 7&1Dt*  s   )+c                     g r%   r&   r  s        r)   do_mapr    r  r,   c                    g r%   r&   r  s       r)   r  r    r  r,   c                   #    U(       a>  [        XU5      n[        U5        S h  vN n[        U" U5      5      I S h  vN 7v   M'  g  N# N
 g 7fr%   )r  r   r   r  s         r)   r  r    sI      7&1$U+ 	/$"4:...	 	/. ,s5   AAA	AAA
A	AAAc                      [        XX#S S5      $ )af  Filters a sequence of objects by applying a test to each object,
and only selecting the objects with the test succeeding.

If no test is specified, each object will be evaluated as a boolean.

Example usage:

.. sourcecode:: jinja

    {{ numbers|select("odd") }}
    {{ numbers|select("odd") }}
    {{ numbers|select("divisibleby", 3) }}
    {{ numbers|select("lessthan", 42) }}
    {{ strings|select("equalto", "mystring") }}

Similar to a generator comprehension such as:

.. code-block:: python

    (n for n in numbers if test_odd(n))
    (n for n in numbers if test_divisibleby(n, 3))

.. versionadded:: 2.7
c                     U $ r%   r&   r  s    r)   <lambda> sync_do_select.<locals>.<lambda>       Ar,   Fselect_or_rejectr   r7   r=  r>  s       r)   sync_do_selectr    s    8 GD+uMMr,   zt.AsyncIterator[V]c                 (   #    [        XX#S S5      $ 7f)Nc                     U $ r%   r&   r  s    r)   r  do_select.<locals>.<lambda>*      !r,   Fasync_select_or_rejectr  s       r)   	do_selectr  #  s      "'$USS   c                      [        XX#S S5      $ )a  Filters a sequence of objects by applying a test to each object,
and rejecting the objects with the test succeeding.

If no test is specified, each object will be evaluated as a boolean.

Example usage:

.. sourcecode:: jinja

    {{ numbers|reject("odd") }}

Similar to a generator comprehension such as:

.. code-block:: python

    (n for n in numbers if not test_odd(n))

.. versionadded:: 2.7
c                     U (       + $ r%   r&   r  s    r)   r   sync_do_reject.<locals>.<lambda>D      Er,   Fr  r  s       r)   sync_do_rejectr  -  s    . GD/5QQr,   c                 (   #    [        XX#S S5      $ 7f)Nc                     U (       + $ r%   r&   r  s    r)   r  do_reject.<locals>.<lambda>N      a%r,   Fr  r  s       r)   	do_rejectr  G  s      "'$QVWWr  c                      [        XX#S S5      $ )a%  Filters a sequence of objects by applying a test to the specified
attribute of each object, and only selecting the objects with the
test succeeding.

If no test is specified, the attribute's value will be evaluated as
a boolean.

Example usage:

.. sourcecode:: jinja

    {{ users|selectattr("is_active") }}
    {{ users|selectattr("email", "none") }}

Similar to a generator comprehension such as:

.. code-block:: python

    (user for user in users if user.is_active)
    (user for user in users if test_none(user.email))

.. versionadded:: 2.7
c                     U $ r%   r&   r  s    r)   r  $sync_do_selectattr.<locals>.<lambda>l  r  r,   Tr  r  s       r)   sync_do_selectattrr  Q  s    6 GD+tLLr,   c                 (   #    [        XX#S S5      $ 7f)Nc                     U $ r%   r&   r  s    r)   r  do_selectattr.<locals>.<lambda>v  r  r,   Tr  r  s       r)   do_selectattrr  o  s      "'$TRRr  c                      [        XX#S S5      $ )a  Filters a sequence of objects by applying a test to the specified
attribute of each object, and rejecting the objects with the test
succeeding.

If no test is specified, the attribute's value will be evaluated as
a boolean.

.. sourcecode:: jinja

    {{ users|rejectattr("is_active") }}
    {{ users|rejectattr("email", "none") }}

Similar to a generator comprehension such as:

.. code-block:: python

    (user for user in users if not user.is_active)
    (user for user in users if not test_none(user.email))

.. versionadded:: 2.7
c                     U (       + $ r%   r&   r  s    r)   r  $sync_do_rejectattr.<locals>.<lambda>  r  r,   Tr  r  s       r)   sync_do_rejectattrr  y  s    2 GD/4PPr,   c                 (   #    [        XX#S S5      $ 7f)Nc                     U (       + $ r%   r&   r  s    r)   r  do_rejectattr.<locals>.<lambda>  r  r,   Tr  r  s       r)   do_rejectattrr    s      "'$QUVVr  indentc                     U R                   R                  nUS   nUS   nUb  UR                  5       nX%S'   [        U4SU0UD6$ )a  Serialize an object to a string of JSON, and mark it safe to
render in HTML. This filter is only for use in HTML documents.

The returned string is safe to render in HTML documents and
``<script>`` tags. The exception is in HTML attributes that are
double quoted; either use single quotes or the ``|forceescape``
filter.

:param value: The object to serialize to JSON.
:param indent: The ``indent`` parameter passed to ``dumps``, for
    pretty-printing the value.

.. versionadded:: 2.9
zjson.dumps_functionzjson.dumps_kwargsr  dumps)r?   r  copyr   )rr   r7   r  r  r  r>  s         r)   	do_tojsonr    sY    $ ##,,H*+E)*F!xu<E<V<<r,   c                   ^ ^^^ T(       dg  ST;   aa  TR                  S5      nTR                  SS 5      nT(       a!  [        S[        [        T5      5      < 35      e[	        T R
                  X4S9nU$  TS   mTSS  mS[        R                  S	[        R                  4UU UU4S
 jjnU$ ! [         a    [        S5      S ef = f)Nr@   rB   zUnexpected keyword argument rp  r   r   zmap requires a filter argumentrD   r#   c                 >   > TR                   R                  TU TTTS9$ )N)r   )r?   call_filterrD   r=  r   r>  r  s    r)   r   prepare_map.<locals>.func  s,    &&22dD&' 3  r,   )	r  r   r   r   rM   r?   LookupErrorr:   rL   )r   r=  r>  r@   rB   r   r  s   ```   @r)   r  r    s     K6)JJ{+	**Y-%.tDL/A.DE  w22IO K	R7D8D	quu 	 	 	
 K  	R%&FGTQ	Rs   4
B+ +Cmodfunclookup_attrc                 d  ^ ^^^^^^	 U(       a   TS   n[        T R                  U5      m	SnOSnS[        S[        4S jm	 TU   mTSU-   S  mS[
        R                  S[
        R                  4UU UU4S jjmUUU	4S	 j$ ! [          a    [        S5      S ef = f! [          a	    [        m N4f = f)
Nr   z$Missing parameter for attribute namer   r`   r#   c                     U $ r%   r&   r  s    r)   	transfunc+prepare_select_or_reject.<locals>.transfunc  r  r,   rD   c                 B   > TR                   R                  TU TTT5      $ r%   )r?   	call_testr  s    r)   r   &prepare_select_or_reject.<locals>.func  s"    &&00tT67SSr,   c                 ,   > T" T" T" U 5      5      5      $ r%   r&   )rD   r   r  r  s    r)   r  *prepare_select_or_reject.<locals>.<lambda>  s    Yt_ 56r,   )r  r   rM   r?   r6   r:   rL   bool)
r   r=  r>  r  r  r[   offr   r  r  s
   ````   @@@r)   prepare_select_or_rejectr    s     	X7D $G$7$7>		 	q 	CyAGI	Tquu 	T 	T 	T 76+  	X%&LMSWW	X$  s   B 8B BB/.B/c              #   n   #    U(       a*  [        XX4U5      nU H  nU" U5      (       d  M  Uv   M     g g 7fr%   )r  r   r7   r=  r>  r  r  r   rD   s           r)   r  r    s5      'vTDDzz
  s   %5
5c                   #    U(       a7  [        XX4U5      n[        U5        S h  vN nU" U5      (       d  M  U7v   M  g  N
 g 7fr%   )r  r   r  s           r)   r  r  
  sB      'vT$U+ 	$Dzz
 	+s*    AAAAAAAAabsbatchr   r   dictsortr  r   filesizeformatr   forceescapeformatr   r_   rp   lastr   r<   rS   r   r   r   pprintr   reject
rejectattrrz   r_  safeselect
selectattrslicesortstringrF  r|  titletrimtruncateuniquer}   	urlencoder   	wordcount)wordwrapxmlattrtojson)NNr%   )T)Fr   F)FFN)FN)r   F)r   N)P   )r?   r   r   r   r#   r   )r?   r   r   r   r#   r   )r?   r   r   zt.Reversible[V]r#   r   )r   r   r   zt.Sequence[V]r#   r   )F)NFNNN)   FF)   Fz...N)O   TNT)r   r^  )g        )r   r]  )NF)Nr   )r7   r   r#   r   )r7   r   r#   r   )r7   r   r#   r   )__doc__ra  r   retypingr:   collectionsr   inspectr   	itertoolsr   r   
markupsafer   r	   r
   async_utilsr   r   r   r   
exceptionsr   runtimer   utilsr   r   r   r   r   r   r   TYPE_CHECKINGtyping_extensionster?   r   nodesr   r   sandboxr   Protocolr!   TypeVarCallablerL   r3   r5   r6   r>   OptionalUnionr1   r_   rM   rY   rZ   rK   rc   r   rn   r   rq   r{   r   r   Iteratorr   compileASCIIr   r  r   r   r   r   r   r   r   r   r   r   r   r   r   AsyncIterabler   r   r   r   r   r   r   r  r  r  r  r   r)  r3  r5  r7  r:  r<  r@  rD  rG  rR  rT  rW  rb  
NamedTuplerd  rw  ry  r}  r  r  r  r  r  overloadr  r  r  r  r  r  r  r  r  r  r  r  r  Dictr  r  r  r  r  rQ   FILTERSr&   r,   r)   <module>r$     sN   =   	    "      & # # % +  &  # $   ??"(" -"++ 
 IIcCJ/0IIcNIIcNq Q  ;?!%	zz!''#s(+, AJJw~67 ZZ	
 ZZ> ;?&&zz!''#s(+,& AJJw~67& ZZ&'	&R	
**QWWS#X&
'	VVAGGCH	1 f 773		#quu*-qzz!''#quu*:M/NNO> RV : : # :*- :47 :@A

3 : :  :F  
  
AGGAIIadOY67 AJJqwwqRSt}<U @ zz*BHH5 IM:: !		#quu* 5:BF:: :z$S $S $ ::&67 
 
 
 !',	&A99QT?&A&A 	%&A 	&A
 VVAGGAqDM&AR   /3484848 48 	48
 zz!''#s(+,48 48 48n  !/3	  zz!''#s(+,	
  @ ~ !/3	7  zz!''#s(+,	
  222 2 	2
 zz!''#s(+,2 2(  !/3	KKK K zz!''#s(+,	K
 K K&  !/3	KKK K zz!''#s(+,	K
 K K*   	B  /3	6262::aee62 62 zz!''#s(+,	62
 	62 62r | /3	KK771??155)1::aee+<<=K K zz!''#s(+,	K
 	K K)S ) )c )
 KK%4KK K }KK%QKK K JJ%6JJ J* T T5QWWS%_5 5t 5PS 5BQUU s 
 78  '+"15LLL JJsOL 	L
 JJsOL 
CL ::ajjo.L 	L L` NS-
-7738$-15-FJ--`  ",	,
, , 	,
 
, JJsO, 	, ,^  !"&!44
4 4 	4
 

34 4 	4 4n ::f.C .C .
!%% #  c ,AEE E E .S . .!%% .C .8(3 (qzz# (# (
*/ *C * IM((&)(6E((V } $(G7GG zz!%% G 	G G JN""'*"7F""N 6>%J%J%J 4%J 	%JP
#!,, 
# 
 "& PPP wwsCx P ZZ	P
 P P Pf 
 "& 7 wwsCx  ZZ	
    4  04	    zz!''#s(+,  	 
    4 { 04	: zz!''#s(+, 	
  * |% %  # # 
  &c &c &  &  >  >Jaggc1::a=01 Jaggc1::a=>P6Q J$ **%&UU*25*WWY* *0 ::aee  55	
 ee ZZ  
 !%::aee 	
 ZZ ZZ  .. zz!%%0.9:.JK%%.ZZ. .b 771??155)1::aee+<<=  55	
 ee ZZ  
 !%771??155)1::aee+<<= 	
 ZZ ZZ  {
/
/771??155)1::aee+<<=
/ 55
/ ee	
/
 __QUU
/ 
/ NN.N78uuNHINN N< ~TT7T 55T ee	T
 T T RR.R78uuRHIRR R2 ~XX7X 55X ee	X
 X X MM.M78uuMHIMM M: !"SS7S 55S ee	S
 S #S QQ.Q78uuQHIQQ Q6 !"WW7W 55W ee	W
 W #W EI==$%EE=34::c?== =8ggaeeSj1;<66#quu*;MZZ877
''!%%*
7 FF3:7 ZZ'	7
 7 ZZ7D ''!%%*
 FF3:	
 ZZ'   7 ''!%%*
 FF3:	
 ZZ'   7	37
G7 X7 -	7
 i7 S7 7 z7 7 7 f7 '7 X7 X7 >7  i!7" z#7$ i%7& 
6'7( G)7* G+7, c-7. G/70 X172 X374 
6576 
6778 
697: i;7< i=7> i?7@ -A7B zC7D zE7F XG7H LI7J iK7L -M7N XO7P GQ7R hS7T U7V 
6W7X XY7Z G[7\ ]7^ i_7` Xa7b c7d ie7f g7h m7r,   