o
    &?eP                     @   s   d Z ddlZddlZejdddd Zejdddd Zejd	d
dd Zejd	ddd Z	ejdej
ejejfdd Zejdej
ejejfdd Zdd ZdS )zAUnit tests for the :mod:`networkx.generators.expanders` module.

    Nn)            
   c                 C   s   t | }| | |  ksJ |D ].}||dksJ t|dks$J |D ]}t||ks0J d|  kr;| k s>J  J q&qd S )N   r   r   )nxmargulis_gabber_galil_graphZnumber_of_nodesZdegreelenint)r   gnodei r   i/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/networkx/generators/tests/test_expanders.py+test_margulis_gabber_galil_graph_properties
   s   
r   c                 C   sV   t d}t d}t| }t|jt| }|d d|	d k s)J d S )NnumpyZscipyr   r   )
pytestZimportorskipr	   r
   sortedZlinalgZeigvalshZadjacency_matrixZtoarraysqrt)r   npspr   wr   r   r   (test_margulis_gabber_galil_graph_eigvals   s
   


r   p)r   r         c                 C   s   t | }t|| ksJ dS )z;Test for the :func:`networkx.chordal_cycle_graph` function.N)r	   chordal_cycle_graphr   )r   Gr   r   r   test_chordal_cycle_graph"   s   
r!   )r   r   r   r      c                    s   t |  t | ksJ  fdd jD } fdd jD }t|dkr1| | d d ks3J t|dkrC| | d d ksEJ | d dkr\ jD ]\}}||f jv s[J qNdS dS )z3Test for the :func:`networkx.paley_graph` function.c                       h | ]}  |qS r   )Z	in_degree.0r   r    r   r   	<setcomp>6       z#test_paley_graph.<locals>.<setcomp>c                    r#   r   )Z
out_degreer$   r&   r   r   r'   7   r(      r      N)r	   paley_graphr   nodespopedges)r   Z
in_degreesZout_degreesuvr   r&   r   test_paley_graph/   s   
$$r1   
graph_typec                 C   D   t jtjdd tjd| d W d    d S 1 sw   Y  d S Nz/`create_using` must be an undirected multigraphmatchr   Zcreate_using)r   raisesr	   NetworkXErrorr
   r2   r   r   r   )test_margulis_gabber_galil_graph_badinputB   
   "r;   c                 C   r3   r4   )r   r8   r	   r9   r   r:   r   r   r   !test_chordal_cycle_graph_badinputJ   r<   r=   c                   C   sF   t jtjdd tjdtjd W d    d S 1 sw   Y  d S )Nz&`create_using` cannot be a multigraph.r5   r   r7   )r   r8   r	   r9   r+   Z
MultiGraphr   r   r   r   test_paley_graph_badinputR   s
   "r>   )__doc__r   Znetworkxr	   markZparametrizer   r   r!   r1   ZGraphZDiGraphZMultiDiGraphr;   r=   r>   r   r   r   r   <module>   s     





