Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/traitlets/utils/__pycache__/descriptions.cpython-39.pyc
Ðазад
a _�h� � @ s� d dl mZ d dlZd dlZd dlZd dlmZ dddddddd �d d�Zddd�d d�Zddd�dd�Z dddddd�dd�Z ddd�dd�ZdS )� )�annotationsN)�AnyFz str | Noner �bool�str)�article�value�name�verbose�capital�returnc C s� t | t�r| �� } t�|�s(t|�j}n|j}|r>t|�| }| dks\| du �rDt�|��sD|dur�|� d|� �}| dur�t|d|�S |S n�d}t�|�r�|j}nlt |t j �r�|j}d}nTt |t j�r�|jj}d}n:t|�j tj tj fv �rdtt|�� }d}nt|�}d}|�r t|�| }|�r0|�d�}t| ||||d�S n:| d v �sX| du �rr| du �rf|S t|d|�S td | ��dS )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' ZtheN� TFzat '%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�resultZ tick_wrap� r% ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/traitlets/utils/descriptions.pyr! sT > � �r! )r r c C sR t | tj�r"td | jdd�d }n,t�| �}|d urJ|jdkrJ|jd }nd}|S )NT)r �.�builtins� )r r r r! �__self__r � getmoduler )r r �moduler% r% r&