Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/isort/__pycache__/place.cpython-39.pyc
Ðазад
a g�h3 � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlmZm Z m Z mZ ddlm Z ddlmZmZ dd lmZ d Zefeeed�dd �Zedd�efeeeeef d�dd��Zeee eeef d�dd�Zeee eeef d�dd�Zeee eeef d�dd�Zd(eee e e eedf e eeef d�dd�Zeed�dd�Zeed�d d!�Zeee ed"�d#d$�Zeeed%�d&d'�ZdS ))zIContains all logic related to placing an import within a certain section.� N)�fnmatch)� lru_cache)�Path)� FrozenSet�Iterable�Optional�Tuple)�sections)�DEFAULT_CONFIG�Config)�exists_case_sensitiveZLOCALFOLDER)�name�config�returnc C s t | |�d S )z8Returns the section placement for the given module name.r )�module_with_reason�r r � r �{/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/isort/place.py�module s r i� )�maxsizec C s2 t | |�p0t| |�p0t| |�p0t| |�p0|jdfS )zPReturns the section placement for the given module name alongside the reasoning.z.Default option in Config or universal default.)�_forced_separate�_local�_known_pattern� _src_path�default_sectionr r r r r s ����r c C sT |j D ]H}|}|�d�s"|� d�}t| |�s:t| d| �r|d|� d�f S qd S )N�*�.zMatched forced_separate (z) config value.)�forced_separate�endswithr )r r r � path_globr r r r ! s r c C s | � d�rtdfS d S )Nr zModule name started with a dot.)� startswith�LOCALr r r r r . s r c sp | � d�� � fdd�tt� �dd�D �}|D ]>}|jD ]2\}}||jv r6|�|�r6|d|� �f S q6q,d S )Nr c 3 s | ]}d � � d|� �V qdS )r N)�join)�.0Zfirst_k��partsr r � <genexpr>7 � z!_known_pattern.<locals>.<genexpr>r ���z!Matched configured known pattern )�split�range�lenZknown_patternsr �match)r r Zmodule_names_to_checkZmodule_name_to_check�patternZ placementr r$ r r 5 s r r .)r r � src_paths�prefixr c C s� |d u r|j }| �dd�^}}g |�|�R }d�|�}|D ]�}|| �� } |sh| �� sh|j|krh|�� } |r�||jv s�|jr�t| |j �r�t |d || f|� S t| �s�t| �s�t ||�r:tjd|� d�f S q:d S )Nr � r z*Found in one of the configured src_paths: )r. r) r"