ó ŸÃÒYc@sIdZdjddgƒZdgZddlZdeedd„Z dS( s Ego graph. s s!Drew Conway sAric Hagberg t ego_graphiÿÿÿÿNic Csæ|rf|dk r?tj|jƒ|d|d|ƒ\}}q·ttj|jƒ|d|ƒƒ}nQ|dk r™tj||d|d|ƒ\}}nttj||d|ƒƒ}|j|ƒjƒ}|sâ|j|ƒn|S(sï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. tcutofftweightN( tNonetnxtsingle_source_dijkstrat to_undirectedtdictt"single_source_shortest_path_lengthtsubgraphtcopyt remove_node( tGtntradiustcentert undirectedtdistancetspt_tH((sm/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/generators/ego.pyRs #     ( t__doc__tjoint __author__t__all__tnetworkxRtTruetFalseRR(((sm/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/generators/ego.pyts