§
    ‹ŸjÃ  ã                  óh   — d dl mZ d dlZd dlZd dlZd dlmZ 	 	 	 ddd„Zdd„Zdd„Z	ddd„Z
dd„ZdS )é    )ÚannotationsN)ÚAnyFÚarticleú
str | NoneÚvaluer   ÚnameÚverboseÚboolÚcapitalÚreturnÚstrc                óÀ  — t          | t          ¦  «        r|                      ¦   «         } t          j        |¦  «        st          |¦  «        j        }n|j        }|rt          |¦  «        |z   }| dk    s| �€<t          j        |¦  «        �s'|�|› d|› �}| �t          |d|¦  «        S |S d}t          j        |¦  «        r|j        }n¬t          |t          j
        ¦  «        r
|j        }d}nˆt          |t          j        ¦  «        r|j        j        }d}n_t          |¦  «        j        t          j        t
          j        fv r"dt          t!          |¦  «        ¦  «        z  }d}nt#          |¦  «        }d}|rt          |¦  «        |z   }|r|                     d¦  «        }t'          | ||||¬¦  «        S | d	v s| €| €|S t          |d|¦  «        S t)          d
| z  ¦  «        ‚)aý  Return string that describes a value

    Parameters
    ----------
    article : str or None
        A definite or indefinite article. If the article is
        indefinite (i.e. "a" or "an") the appropriate one
        will be inferred. Thus, the arguments of ``describe``
        can themselves represent what the resulting string
        will actually look like. If None, then no article
        will be prepended to the result. For non-articled
        description, values that are instances are treated
        definitely, while classes are handled indefinitely.
    value : any
        The value which will be named.
    name : str or None (default: None)
        Only applies when ``article`` is "the" - this
        ``name`` is a definite reference to the value.
        By default one will be inferred from the value's
        type and repr methods.
    verbose : bool (default: False)
        Whether the name should be concise or verbose. When
        possible, verbose names include the module, and/or
        class name where an object was defined.
    capital : bool (default: False)
        Whether the first letter of the article should
        be capitalized or not. By default it is not.

    Examples
    --------
    Indefinite description:

    >>> describe("a", object())
    'an object'
    >>> describe("a", object)
    'an object'
    >>> describe("a", type(object))
    'a type'

    Definite description:

    >>> describe("the", object())
    "the object at '...'"
    >>> describe("the", object)
    'the object object'
    >>> describe("the", type(object))
    'the type type'

    Definitely named description:

    >>> describe("the", object(), "I made")
    'the object I made'
    >>> describe("the", object, "I will use")
    'the object I will use'
    ÚtheNú TFzat '%s'z'')r   r	   r   )ÚaÚanzAThe 'article' argument should be 'the', 'a', 'an', or None not %r)Ú
isinstancer   ÚlowerÚinspectÚisclassÚtypeÚ__name__Ú_prefixÚadd_articleÚtypesÚFunctionTypeÚ
MethodTypeÚ__func__Ú__repr__ÚobjectÚhexÚidÚreprÚjoinÚdescribeÚ
ValueError)r   r   r   r	   r   ÚtypenameÚresultÚ	tick_wraps           úi/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/traitlets/utils/descriptions.pyr%   r%   	   s  € õ| �'�3ÑÔð "Ø—-’-‘/”/ˆåŒ?˜5Ñ!Ô!ð "Ý˜‘;”;Ô'ˆˆà”>ˆØð -Ý˜5‘>”> HÑ,ˆà�%ÒÐ˜G™OµG´OÀEÑ4JÔ4J™OØÐØ Ð)Ð) 4Ð)Ð)ˆFØÐ"Ý" 6¨4°Ñ9Ô9Ð9à�àˆIÝŒ˜uÑ%Ô%ð  Ø”~��Ý˜E¥5Ô#5Ñ6Ô6ð  Ø”~�Ø �	�	Ý˜E¥5Ô#3Ñ4Ô4ð  Ø”~Ô.�Ø �	�	Ý�e‘”Ô%Ý”Ý”ð*ð ð ð !¥3¥r¨%¡y¤y¡>¤>Ñ1�Ø��å˜E‘{”{�Ø�Øð -Ý˜u‘~”~¨Ñ,�Øð 'Ø—y’y ‘”�Ý˜G U°¸wÐPWÐXÑXÔXÐXØ	�KÐ	Ð	 7 ?Øˆ?ØˆOÝ˜8 U¨GÑ4Ô4Ð4åØOÐRYÑYñ
ô 
ð 	
ó    c                óÌ   — t          | t          j        ¦  «        rt          d | j        d¬¦  «        dz   }n.t          j        | ¦  «        }|�|j        dk    r|j        dz   }nd}|S )NT)r	   ú.ÚbuiltinsÚ )r   r   r   r%   Ú__self__r   Ú	getmoduler   )r   r   Úmodules      r*   r   r   z   sn   € Ý�%�Ô)Ñ*Ô*ð Ý˜˜eœn°dÐ;Ñ;Ô;¸cÑAˆˆåÔ" 5Ñ)Ô)ˆØÐ &¤/°ZÒ"?Ð"?Ø”? SÑ(ˆDˆDàˆDØ€Kr+   c                óŠ   — t          j        | ¦  «        rt          | j        ¦  «        S t	          t          | ¦  «        ¦  «        S )zsReturns a string of the value's type with an indefinite article.

    For example 'an Image' or 'a PlotValue'.
    )r   r   r   r   Úclass_ofr   )r   s    r*   r4   r4   †   s:   € õ
 „�uÑÔð %Ý˜5œ>Ñ*Ô*Ð*å�˜U™œÑ$Ô$Ð$r+   Údefinitec                ó  — |rd| z   }nQt          j        d¦  «                             d| ¦  «        }|dd…                              ¦   «         dv rd| z   }nd| z   }|r%|d	                              ¦   «         |dd…         z   S |S )
aè  Returns the string with a prepended article.

    The input does not need to begin with a character.

    Parameters
    ----------
    name : str
        Name to which to prepend an article
    definite : bool (default: False)
        Whether the article is definite or not.
        Indefinite articles being 'a' and 'an',
        while 'the' is definite.
    capital : bool (default: False)
        Whether the added article should have
        its first letter capitalized or not.
    zthe z[\W_]+r/   Né   Úaeiouzan za r   )ÚreÚcompileÚsubr   Úupper)r   r5   r   r(   Úfirst_letterss        r*   r   r   ‘   s˜   € ð" ð !Ø˜$‘ˆˆåœ
 9Ñ-Ô-×1Ò1°"°dÑ;Ô;ˆØ˜˜!˜Ô×"Ò"Ñ$Ô$¨Ð/Ð/Ø˜T‘\ˆFˆFà˜D‘[ˆFØð Ø�aŒy�ŠÑ Ô  6¨!¨"¨"¤:Ñ-Ð-àˆr+   Úobjc                ó.   — t          | ¦  «        }| ›d|›�S )z]Return a string representation of a value and its type for readable

    error messages.
    r   )r   )r>   Úthe_types     r*   Ú	repr_typerA   °   s#   € õ
 �C‰yŒy€HØÐ"Ð"�hÐ"Ð"Ð"r+   )NFF)r   r   r   r   r   r   r	   r
   r   r
   r   r   )r   r   r   r   )r   r   r   r   )FF)r   r   r5   r
   r   r
   r   r   )r>   r   r   r   )Ú
__future__r   r   r9   r   Útypingr   r%   r   r4   r   rA   © r+   r*   ú<module>rE      sÍ   ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ð Ð ð ØØðn
ð n
ð n
ð n
ð n
ðb	ð 	ð 	ð 	ð%ð %ð %ð %ðð ð ð ð ð>#ð #ð #ð #ð #ð #r+   