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","."]
code: def add_unobserved_common_cause(
      self, observed_node_names, color="gray"
  ):
      # Adding unobserved confounders
      current_common_causes = self.get_common_causes(
          self.treatment_name, self.outcome_name
      )
      create_new_common_cause = True
      for node_name in current_common_causes:
          if self._graph.nodes[node_name]["observed"] == "no":
              create_new_common_cause = False
      if create_new_common_cause:
          uc_label = "Unobserved Confounders"
          self._graph.add_node(
              "U",
              label=uc_label,
              observed="no",
              color=color,
              style="filled",
              fillcolor=color,
          )
          for node in self.treatment_name + self.outcome_name:
              self._graph.add_edge("U", node)
          self.logger.info(
              'If this is observed data (not from a randomized experiment), there might always be missing confounders. Adding a node named "Unobserved Confounders" to reflect this.'
          )
      return self._graph
  
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 6 for calling the CausalGraph obj's underlying member method code with example usage: obj.add_unobserved_common_cause(observed_node_names, color) and returns: self