def cliques_containing_node(G, nodes=None, cliques=None):
 if (cliques is None):
  cliques = list(find_cliques(G))
 if (nodes is None):
  nodes = list(G.nodes())
 if (not isinstance(nodes, list)):
  v = nodes
  vcliques = [c for c in cliques if (v in c)]
 else:
  vcliques = {}
  for v in nodes:
   vcliques[v] = [c for c in cliques if (v in c)]
 return vcliques

def cliques_containing_node ( G , nodes = None , cliques = None ) : if ( cliques is None ) : cliques = list ( find_cliques ( G ) ) if ( nodes is None ) : nodes = list ( G . nodes ( ) ) if ( not isinstance ( nodes , list ) ) : v = nodes vcliques = [ c for c in cliques if ( v in c ) ] else : vcliques = { } for v in nodes : vcliques [ v ] = [ c for c in cliques if ( v in c ) ] return vcliques
returns a list of cliques containing the given node .