U
    9vfP
                     @   s   d dl Zd dl mZmZmZmZmZ G dd deZG dd deZG dd deZ	G d	d
 d
eZ
G dd deZdd ZG dd dZe ZdS )    N)DiGraphGraphMultiDiGraph
MultiGraphPlanarEmbeddingc                   @   s   e Zd ZdZdS )LoopbackGraphnx-loopbackN__name__
__module____qualname__Z__networkx_plugin__ r   r   M/tmp/pip-unpacked-wheel-_lngutwb/networkx/classes/tests/dispatch_interface.pyr      s   r   c                   @   s   e Zd ZdZdS )LoopbackDiGraphr   Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )LoopbackMultiGraphr   Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )LoopbackMultiDiGraphr   Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )LoopbackPlanarEmbeddingr   Nr	   r   r   r   r   r   !   s   r   c                 C   sp   t | trt| S t | tr$t| S t | tr6t| S t | trHt| S t | t	rZt
| S tdt|  d S )NzUnsupported type of graph: )
isinstancer   r   r   r   r   r   r   r   r   r   	TypeErrortype)graphr   r   r   convert%   s    




r   c                   @   st   e Zd Zejjjejjj	ejj
jejjjejjjdZdd ZedddddZedddd	Zed
d ZdS )LoopbackDispatcher)inter_community_edgesis_tournamentmutual_weightscore_sequencetournament_matrixc                 C   s8   t t|rtt|jS || jkr,| j| jS t|d S N)hasattrnxgetattrZ
_orig_funcnon_toplevelAttributeError)selfitemr   r   r   __getattr__<   s
    

zLoopbackDispatcher.__getattr__N)namec                C   s   | S r   r   )r   Zweightr'   r   r   r   convert_from_nxD   s    z"LoopbackDispatcher.convert_from_nxc                C   s   | S r   r   )objr'   r   r   r   convert_to_nxH   s    z LoopbackDispatcher.convert_to_nxc                 C   s   | D ]}t |dstqd S )NZ
add_marker)r   AssertionError)itemsr%   r   r   r   on_start_testsL   s    z!LoopbackDispatcher.on_start_tests)N)r
   r   r   r    Z	communityZqualityr   Z
algorithmsZ
tournamentr   Zstructuralholesr   r   r   r"   r&   staticmethodr(   r*   r-   r   r   r   r   r   3   s   r   )Znetworkxr    r   r   r   r   r   r   r   r   r   r   r   r   
dispatcherr   r   r   r   <module>   s    