OwlCyberSecurity - MANAGER
Edit File: parallel.cpython-311.pyc
� ������h�����������������������.����U�d�dl�mZ�d�dlZd�dlZd�dlmZ�d�dlmZmZ�d�dl m Z mZ�d�dlZd�dl mZ�d�dlmZ�d�dlmZ�d�d lmZ�d�d lmZmZ� �d�dlZn #�e$�r�dZY�nw�xY�w �d�dlmZ�n #�e$�r�dZY�nw�xY�we rd�dlmZ�dad ed<��� �d#d$d�Z d%d�Z!d&d�Z" �d#d'd"�Z#dS�)(�����)�annotationsN)�defaultdict)�Iterable�Sequence)� TYPE_CHECKING�Any)� reporters)�_augment_sys_path)�Message)�FileItem)�LinterStats�merge_stats)�ProcessPoolExecutor)�PyLinterzPyLinter | None�_worker_linter�linter�bytes�extra_packages_paths�Sequence[str] | None�return�Nonec�����������������������t����������j��������|�������������at����������sJ��t�������������������������������t ����������j�����������������������������������t����������������������������������������������|rt����������|�������������dS�dS�)z�Function called to initialize a worker for a Process within a concurrent Pool. :param linter: A linter-class (PyLinter) instance pickled with dill :param extra_packages_paths: Extra entries to be added to sys.path N)�dill�loadsr����set_reporterr ����CollectingReporter�openr ���)r���r���s��� �e/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/pylint/lint/parallel.py�_worker_initializer���'���sv��������Z��'�'�N����>����� � <� >� >�?�?�?���������0��.�/�/�/�/�/�0��0������ file_itemr����etuple[int, str | None, str, str | None, list[Message], LinterStats, int, defaultdict[str, list[Any]]]c����������������� ����t�����������st����������d�������������t�����������������������������������������������t��������������������������������|��������������t ����������t ����������������������}t����������������������������������������������D�]8}|�����������������������������������}|� ||j������������������ ��������������������|��������������9t�����������j ��������j��������}t����������t�����������j ��������t����������j��������������������sJ��t�����������j ��������������������������������������������t�����������j���������t#����������j��������dt&�����������������������t)����������t+����������j����������������������������������t�����������j��������|�j��������t�����������j��������j��������|t�����������j��������t�����������j��������|fS�)Nz!Worker linter not yet initialisedz�In pylint 3.0 the current_name attribute of the linter object should be a string. If unknown it should be initialized as an empty string.)r����RuntimeErrorr����check_single_file_itemr����list�get_checkers�get_map_data�name�append�reporter�messages� isinstancer ���r����reset�current_name�warnings�warn�DeprecationWarning�id�multiprocessing�current_process�filepath� file_state� base_name�stats� msg_status)r!����mapreduce_data�checker�data�msgss��� r����_worker_check_single_filer?���<���sH��������@��>�?�?�?��������)�)�)�4�4�4� ��&�&�N�!�.�.�0�0��6��6���#�#�%�%�����7�<�(�/�/��5�5�5���"�+�D��n�-�y�/K�L�L�L�L�L���!�!�#�#�#��"�*�� �J�� � �� �� �� �?�*�,�,�-�-��#����!�+�����!�� �� r ���r����all_mapreduce_data�3defaultdict[int, list[defaultdict[str, list[Any]]]]c�����������������V����t����������t����������������������}|�����������������������������������D�]<}|D�]7}|�����������������������������������D�] \��}}||������������������������������|��������������!�8�=|������������������������������������}|D�],}|j��������|v�r!|���������������������|�||j�������������������������������-dS�)zJMerges map/reduce data across workers, invoking relevant APIs on checkers.N)r���r&����values�items�extendr'���r)����reduce_map_data) r���r@����collated_map_reduce_data�linter_data�run_data�checker_namer=����original_checkersr<���s ��� r����_merge_mapreduce_datarL���i���s��������=H��<M�<M��)�0�0�2�2��D��D��#�� D�� D�H�&.�n�n�&6�&6�� D�� D�"��d�(��6�=�=�d�C�C�C�C� D� D� ��+�+�-�-��$��T��T���<�3�3�3�� �#�#�F�,D�W�\�,R�S�S�S�� T��Tr ����jobs�int�files�Iterable[FileItem]c����������� �����������t����������j��������t����������|�������������}t����������||t ����������j��������|�������������f�������������5�}|�������������������������������������g�}t����������t����������������������}|� ��������������������t����������|������������D�]�\��}} } }}} }}||�j��������_��������d|�j��������_ ��������|����������������������| | �������������|D�]}|�j�����������������������������|��������������|���������������������| �������������||������������������������������|�������������|�xj��������|z��c_���������� �ddd�������������n#�1�swxY�w�Y���t'����������|�|�������������t)����������|�j��������g|z���������������|�_��������dS�)a��Use the given linter to lint the files with given amount of workers (jobs). This splits the work filestream-by-filestream. If you need to do work across multiple files, as in the similarity-checker, then implement the map/reduce mixin functionality. )r���)�max_workers�initializer�initargsFN)� functools�partialr���r���r����dumpsr���r���r&����mapr?���r7���r8����_is_base_filestate�set_current_moduler+����handle_messager*���r:���rL���r���r9���)r���rM���rO���r���rS����executor� all_statsr@���� worker_idx�module� file_pathr8���r,���r9���r:���r;����msgs��� r����check_parallelrb�������s��������#��1E������K�� ��k�T�Z��=O�=O�<Q� �� �� ��,� ���� � � �� �� ����� � ��\�\�3�U� ;� ;� ,�� ,�� ���������*3�F��'�38�F��0��%�%�f�i�8�8�8��� 4�� 4����.�.�s�3�3�3�3����U�#�#�#��z�*�1�1�.�A�A�A�����+����# ,�,��,��,��,��,��,��,��,��,��,��,�����,��,��,��,�>��&�"4�5�5�5����~� �9�:�:�F�L�L�Ls����CD-�-D1�4D1)N)r���r���r���r���r���r���)r!���r���r���r"���)r���r���r@���rA���r���r���) r���r���rM���rN���rO���rP���r���r���r���r���)$� __future__r���rU���r0����collectionsr����collections.abcr���r����typingr���r���r����pylintr ����pylint.lint.utilsr ����pylint.messager���� pylint.typingr����pylint.utilsr ���r���r4����ImportError�concurrent.futuresr����pylint.lintr���r����__annotations__r���r?���rL���rb�����r ���r����<module>rq������s����� �#��"��"��"��"��"��"���������������#��#��#��#��#��#��.��.��.��.��.��.��.��.��%��%��%��%��%��%��%��%�������������������/��/��/��/��/��/��"��"��"��"��"��"��"��"��"��"��"��"��1��1��1��1��1��1��1��1����������������O�O�O������6�6�6�6�6�6�6��������������������%�$�$�$�$�$�$��#'���&��&��&��&��AE�0��0��0��0��0�**��*��*��*�ZT��T��T��T�8�26� 1;��1;��1;��1;��1;��1;��1;s$����A��A�A�A%��%A/�.A/