%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/samba/kcc/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/samba/kcc/__pycache__/graph_utils.cpython-312.pyc |
� �I�d-0 � � � d dl Z d dlZd dlmZ dd�Z G d� de� Zd� Zd� Zd� Z d � Z d � Zd� Zd� Z d � Zd� Zd� Zdd�Z dd�Zd� Zy)� N)� dot_graphc � � t ||fd|i|��}|r| d|j dd� z z } t j j |d| z � }|� |d|z � t |d� } | j |� | j � y )N�title�_�, � z%s.dotzwriting graph to %s�w)r �replace�os�path�join�open�write�close) �basename� edge_list�vertices�label�dot_file_dir�debug�kwargs�s�filename�fs �7/usr/lib/python3/dist-packages/samba/kcc/graph_utils.py�write_dot_filer s� � ��(�I�=�U�=�f�=�A���C�%�-�-��b�1�1�1���w�w�|�|�L�(�X�*=�>�H��� �#�h�.�/��X�s��A��G�G�A�J��G�G�I� c � � e Zd Zy)� GraphErrorN)�__name__� __module__�__qualname__� r r r r * s � �r r c �� � |D ]i }t � }| D ]3 \ }}||k( r|j |� �||k( s�#|j |� �5 t |� dz t |� k7 s�`t d� � y)zXThe graph is complete, which is to say there is an edge between every pair of nodes.� zgraph is not fully connectedN)�set�add�lenr )�edgesr � edge_vertices�v�remotes�a�bs r �verify_graph_completer/ . st � � � =���%��� �D�A�q��A�v����A���a�����A�� � �w�<�!��s�8�}�,��;�<�<�=r c � � � | st |� dk ryt d� �t | � }t |j � � � g }t |� D ]X \ }}|\ }}|� v r#� j |� |j |� �2|� v s�7� j |� |j |� �Z |snt |� D ] }||= � �|s� t |� k7 r3d} | dj � fd�t |� D � � z } t | � �y)z&There is a path between any two nodes.r% Nz9all vertices are disconnected because there are no edges:zHthe graph is not connected, as the following vertices are unreachable: z c 3 �* �K � | ] }|�vr|�� � y �w�Nr# )�.0r+ �reacheds �r � <genexpr>z)verify_graph_connected.<locals>.<genexpr>X s �� �� � -�a��G�+� � -�s �)r( r �listr&