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: Uses d-separation criteria to decide if conditioned_nodes block given path.
docstr_tok: ["Uses","d-separation","criteria","to","decide","if","conditioned_nodes","block","given","path","."]
code: def is_blocked(self, path, conditioned_nodes):
      """Uses d-separation criteria to decide if conditioned_nodes block given path."""
  
      blocked_by_conditioning = False
      has_unconditioned_collider = False
  
      for i in range(len(path) - 2):
          if self._graph.has_edge(
              path[i], path[i + 1]
          ) and self._graph.has_edge(
              path[i + 2], path[i + 1]
          ):  # collider
              collider_descendants = nx.descendants(
                  self._graph, path[i + 1]
              )
              if path[i + 1] not in conditioned_nodes and all(
                  cdesc not in conditioned_nodes
                  for cdesc in collider_descendants
              ):
                  has_unconditioned_collider = True
          else:  # chain or fork
              if path[i + 1] in conditioned_nodes:
                  blocked_by_conditioning = True
                  break
      if blocked_by_conditioning:
          return True
      elif has_unconditioned_collider:
          return True
      else:
          return False
  
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 13 for calling the CausalGraph obj's underlying member method code with example usage: obj.is_blocked(path, conditioned_nodes) and returns: True, True, False