parameters: (graph, query_set)
return_statement: return closure
docstring: Find all nodes in the graph that cannot be reached from a root without
      passing through :query_set.
docstring_summary: Find all nodes in the graph that cannot be reached from a root without
      passing through :query_set.
docstring_tokens: Find all nodes in the graph that cannot be reached from a root without passing through : query_set .
function: def get_dominated(graph, query_set):
      """
      Find all nodes in the graph that cannot be reached from a root without
      passing through :query_set.
      """
      visited = set()
  
      def mark(node):
          if node in visited:
              return
          if node in query_set:
              return
          visited.add(node)
          for succ in node.succs:
              mark(succ)
  
      seeds = [node for node in graph.nodes.values() if len(node.preds) == 0]
  
      for seed in seeds:
          mark(seed)
  
      closure = set()
      for node in graph.nodes.values():
          if node not in visited:
              closure.add(node)
  
      return closure
function_tokens: def get_dominated ( graph , query_set ) : visited = set ( ) def mark ( node ) : if node in visited : return if node in query_set : return visited . add ( node ) for succ in node . succs : mark ( succ ) seeds = [ node for node in graph . nodes . values ( ) if len ( node . preds ) == 0 ] for seed in seeds : mark ( seed ) closure = set ( ) for node in graph . nodes . values ( ) : if node not in visited : closure . add ( node ) return closure