§
    bŠtjf  ã                   óP   — d Z dgZddlZ ej        dd¬¦  «        d	d„¦   «         ZdS )
z
Ego graph.
Ú	ego_graphé    NT)Úpreserve_all_attrsÚreturns_graphé   Fc                 ó¾  — |rg|�.t          j        |                      ¦   «         |||¬¦  «        \  }}nlt          t          j        |                      ¦   «         ||¬¦  «        ¦  «        }n5|�t          j        | |||¬¦  «        \  }}nt          j        | ||¬¦  «        }|                      |¦  «                             ¦   «         }|s|                     |¦  «         |S )aï  Returns induced subgraph of neighbors centered at node n within
    a given radius.

    Parameters
    ----------
    G : graph
      A NetworkX Graph or DiGraph

    n : node
      A single node

    radius : number, optional
      Include all neighbors of distance<=radius from n.

    center : bool, optional
      If False, do not include center node in graph

    undirected : bool, optional
      If True use both in- and out-neighbors of directed graphs.

    distance : key, optional
      Use specified edge data key as distance.  For example, setting
      distance='weight' will use the edge weight to measure the
      distance from the node n.

    Notes
    -----
    For directed graphs D this produces the "out" neighborhood
    or successors.  If you want the neighborhood of predecessors
    first reverse the graph with D.reverse().  If you want both
    directions use the keyword argument undirected=True.

    Node, edge, and graph attributes are copied to the returned subgraph.
    N)ÚcutoffÚweight)r   )ÚnxÚsingle_source_dijkstraÚto_undirectedÚdictÚ"single_source_shortest_path_lengthÚsubgraphÚcopyÚremove_node)	ÚGÚnÚradiusÚcenterÚ
undirectedÚdistanceÚspÚ_ÚHs	            úU/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/generators/ego.pyr   r   
   sõ   € ðH ð LØÐÝÔ-Ø—’Ñ!Ô! 1¨V¸Hðñ ô ‰EˆB��õ ÝÔ5Ø—O’OÑ%Ô% q°ðñ ô ñô ˆBˆBð ÐÝÔ-¨a°¸6È(ÐSÑSÔS‰EˆB��åÔ6°q¸!ÀFÐKÑKÔKˆBà	�
Š
�2‰Œ×ÒÑÔ€AØð Ø	�Š�aÑÔÐØ€Hó    )r   TFN)Ú__doc__Ú__all__Únetworkxr
   Ú_dispatchabler   © r   r   ú<module>r"      sa   ððð ð ˆ-€à Ð Ð Ð ð €Ô T¸Ð>Ñ>Ô>ð7ð 7ð 7ñ ?Ô>ð7ð 7ð 7r   