code: def is_clique(G, nodes):
      """Returns True if and only if `nodes` is an independent set
      in `G`.
  
      `G` is an undirected simple graph. `nodes` is an iterable of
      nodes in `G`.
  
      """
      H = G.subgraph(nodes)
      n = len(H)
      return H.number_of_edges() == n * (n - 1) // 2
  
file_path: networkx/networkx/algorithms/approximation/tests/test_clique.py
imports: import networkx
  from networkx.algorithms.approximation import clique_removal, large_clique_size, max_clique, maximum_independent_set
label_desc: Use image node_id 2 for calling a global function with example usage: is_clique(G, nodes) and returns: unknown