def _graph_connected_component(graph, node_id):
connected_components = np.zeros(shape=(graph.shape[<NUM_LIT:0>]), dtype=np.bool)<EOL>connected_components[node_id] = True<EOL>n_node = graph.shape[<NUM_LIT:0>]<EOL>for i in range(n_node):<EOL><INDENT>last_num_component = connected_components.sum()<EOL>_, node_to_add = np.where(graph[connected_components] != <NUM_LIT:0>)<EOL>connected_components[node_to_add] = True<EOL>if last_num_component >= connected_components.sum():<EOL><INDENT>break<EOL><DEDENT><DEDENT>return connected_components<EOL>
Find the largest graph connected components the contains one
given node

Parameters
----------
graph : array-like, shape: (n_samples, n_samples)
    adjacency matrix of the graph, non-zero weight means an edge
    between the nodes

node_id : int
    The index of the query node of the graph

Returns
-------
connected_components : array-like, shape: (n_samples,)
    An array of bool value indicates the indexes of the nodes
    belong to the largest connected components of the given query
    node