code: def _get_non_descendants(
      causal_graph: DirectedGraph,
      node: Any,
      exclude_parents: bool = False,
  ) -> List[Any]:
      nodes_to_exclude = nx.descendants(causal_graph, node).union(
          {node}
      )
      if exclude_parents:
          nodes_to_exclude = nodes_to_exclude.union(
              causal_graph.predecessors(node)
          )
      return list(set(causal_graph.nodes).difference(nodes_to_exclude))
  
file_path: dowhy/dowhy/gcm/validation.py
imports: from enum import Enum, auto
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import networkx
  import numpy
  import pandas
  from statsmodels.stats.multitest import multipletests
  from dowhy.gcm.causal_models import InvertibleStructuralCausalModel, validate_causal_graph
  from dowhy.gcm.independence_test import kernel_based
  from dowhy.graph import DirectedGraph, get_ordered_predecessors, is_root_node
label_desc: Use image node_id 3 for calling a global function with example usage: _get_non_descendants(causal_graph, node, exclude_parents) and returns: list