class_docstr: Class for creating and modifying the causal graph.
  
  Accepts a networkx DiGraph, a :py:class:`ProbabilisticCausalModel <dowhy.gcm.ProbabilisticCausalModel`, a graph string (or a text file) in gml format (preferred) or dot format. Graphviz-like attributes can be set for edges and nodes. E.g. style="dashed" as an edge attribute ensures that the edge is drawn with a dashed line.
  
   If a graph string is not given, names of treatment, outcome, and confounders, instruments and effect modifiers (if any) can be provided to create the graph.
class_docstr_tok: ["Class","for","creating","and","modifying","the","causal","graph",".","Accepts","a","networkx","DiGraph",",","a",":","py",":","class",":","`","ProbabilisticCausalModel","<","dowhy.gcm.ProbabilisticCausalModel","`",",","a","graph","string","(","or","a","text","file",")","in","gml","format","(","preferred",")","or","dot","format",".","Graphviz-like","attributes","can","be","set","for","edges","and","nodes",".","E.g",".","style=","''","dashed","''","as","an","edge","attribute","ensures","that","the","edge","is","drawn","with","a","dashed","line",".","If","a","graph","string","is","not","given",",","names","of","treatment",",","outcome",",","and","confounders",",","instruments","and","effect","modifiers","(","if","any",")","can","be","provided","to","create","the","graph","."]
docstr: Assume that the first parameter (nodes1) is the treatment,
  the second is the outcome, and the third is the candidate backdoor set
docstr_tok: ["Assume","that","the","first","parameter","(","nodes1",")","is","the","treatment",",","the","second","is","the","outcome",",","and","the","third","is","the","candidate","backdoor","set"]
code: def check_valid_backdoor_set(
      self,
      nodes1,
      nodes2,
      nodes3,
      backdoor_paths=None,
      new_graph=None,
      dseparation_algo="default",
  ):
      """Assume that the first parameter (nodes1) is the treatment,
      the second is the outcome, and the third is the candidate backdoor set
      """
      # also return the number of backdoor paths blocked by observed nodes
      if dseparation_algo == "default":
          if new_graph is None:
              # Assume that nodes1 is the treatment
              new_graph = self.do_surgery(
                  nodes1, remove_outgoing_edges=True
              )
          dseparated = nx.algorithms.d_separated(
              new_graph, set(nodes1), set(nodes2), set(nodes3)
          )
      elif dseparation_algo == "naive":
          # ignores new_graph parameter, always uses self._graph
          if backdoor_paths is None:
              backdoor_paths = self.get_backdoor_paths(nodes1, nodes2)
          dseparated = all(
              [self.is_blocked(path, nodes3) for path in backdoor_paths]
          )
      else:
          raise ValueError(
              f"{dseparation_algo} method for d-separation not supported."
          )
      return {"is_dseparated": dseparated}
  
imports: import itertools
  import logging
  import re
  import networkx
  from dowhy.gcm.causal_models import ProbabilisticCausalModel
  from dowhy.utils.api import parse_state
  from dowhy.utils.graph_operations import daggity_to_dot
  from dowhy.utils.plotting import plot
label_desc: Use image node_id 11 for calling the CausalGraph obj's underlying member method code with example usage: obj.check_valid_backdoor_set(nodes1, nodes2, nodes3, backdoor_paths, new_graph, dseparation_algo) and returns: dict