#NEWLINE# def is_dominating_set( G , nbunch ) : #NEWLINE# #INDENT# 'Checks if `nbunch` is a dominating set for `G`.\n\n    A *dominating set* for a graph with node set *V* is a subset *D* of\n    *V* such that every node not in *D* is adjacent to at least one\n    member of *D* [1]_.\n\n    Parameters\n    ----------\n    G : NetworkX graph\n\n    nbunch : iterable\n        An iterable of nodes in the graph `G`.\n\n    See also\n    --------\n    dominating_set\n\n    References\n    ----------\n    .. [1] http://en.wikipedia.org/wiki/Dominating_set\n\n    ' #NEWLINE# testset = set ( ( n for n in n if ( n in G ) ) ) #NEWLINE# nbrs = set ( chain . from_iterable ( ( G [ n ] for n in testset ) ) ) #NEWLINE# return ( len ( ( ( set ( G ) - testset ) - nbrs ) ) == 0 )