관리-도구
편집 파일: run.cpython-311.pyc
� �܋fO# � � � d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z mZ d dlm Z d dlmZ d dlmZmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZmZ d dl m!Z! d dl"Z"d dl"m#Z# n # e$$ r dZ"Y nw xY w d dl%m&Z& n # e$$ r dZ&Y nw xY wdd�Z'dd�Z( e)� � Z* G d� d� � Z+ G d� de+� � Z,dS )� )�annotationsN)�Sequence)�Path)�Any�ClassVar)�config)�clear_lru_caches)�_handle_pylint_config_commands�!_register_generate_config_options)�_config_initialization)�ArgumentPreprocessingError)�_preprocess_options)�full_version)�_make_run_options)�MANAGER�PyLinter)�BaseReporter)�synchronize)�ProcessPoolExecutor�return� int | Nonec �h � d\ } }t d� � � � � r\t dd�� � 5 }t |� � � � � � � � } ddd� � n# 1 swxY w Y | r�| dk r�t d� � � � � rot dd�� � 5 }t |� � � � � � � � }ddd� � n# 1 swxY w Y t | |z � � }n�t d� � � � � rnt dd�� � 5 }t |� � � � � � � � }ddd� � n# 1 swxY w Y t |d z � � }|d k rd}|S )z�Try to determine number of CPUs allotted in a docker container. This is based on discussion and copied from suggestions in https://bugs.python.org/issue36054. )NNz#/sys/fs/cgroup/cpu/cpu.cfs_quota_us�utf-8��encodingN���z$/sys/fs/cgroup/cpu/cpu.cfs_period_usz/sys/fs/cgroup/cpu/cpu.sharesi r � )r �is_file�open�int�read�rstrip)� cpu_quota� avail_cpu�file� cpu_period� cpu_sharess �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/lint/run.py� _query_cpur) ( sO � � &��I�y��1�2�2�:�:�<�<� 2� �7�'� J� J� J� 2�d��D�I�I�K�K�.�.�0�0�1�1�I� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2���� 2� 2� 2� 2� �+���O�O��7�8�8�@�@�B�B� � �8�7� K� K� K� 3�t��T�Y�Y�[�[�/�/�1�1�2�2�J� 3� 3� 3� 3� 3� 3� 3� 3� 3� 3� 3���� 3� 3� 3� 3� � �J�.�/�/� � � �-� .� .� 6� 6� 8� 8� +� �1�G� D� D� D� 3���T�Y�Y�[�[�/�/�1�1�2�2�J� 3� 3� 3� 3� 3� 3� 3� 3� 3� 3� 3���� 3� 3� 3� 3� � �T�)�*�*� � �A�~�~�� ��s5 �4A8�8A<�?A<�=4C=�=D�D� 4F � F�Fr c �& � t � � } d}t t dd� � }|rt |d� � � � }nt rt j � � }nd}t j dk rt |d� � }| �t | |� � S |S )zWUse sched_affinity if available for virtualized or containerized environments. N�sched_getaffinityr r �win32�8 ) r) �getattr�os�len�multiprocessing� cpu_count�sys�platform�min)� cpu_sharer2 r+ s r( � _cpu_countr7 N s� � � ���I��I���$7��>�>��� ��)�)�!�,�,�-�-� � � � �#�-�/�/� � �� � �|�w���� �2�&�&� ����9�i�(�(�(��� c �<