class_docstr: Represents a probabilistic graphical causal model, i.e. it combines a graphical representation of causal
  causal relationships and corresponding causal mechanism for each node describing the data generation process. The
  causal mechanisms can be any general stochastic models.
class_docstr_tok: ["Represents","a","probabilistic","graphical","causal","model",",","i.e",".","it","combines","a","graphical","representation","of","causal","causal","relationships","and","corresponding","causal","mechanism","for","each","node","describing","the","data","generation","process",".","The","causal","mechanisms","can","be","any","general","stochastic","models","."]
docstr: :param graph: Optional graph object to be used as causal graph.
  :param graph_copier: Optional function that can copy a causal graph. Defaults to a networkx.DiGraph
                       constructor.
docstr_tok: [":","param","graph",":","Optional","graph","object","to","be","used","as","causal","graph",".",":","param","graph_copier",":","Optional","function","that","can","copy","a","causal","graph",".","Defaults","to","a","networkx.DiGraph","constructor","."]
code: def __init__(
      self,
      graph: Optional[DirectedGraph] = None,
      graph_copier: Callable[
          [DirectedGraph], DirectedGraph
      ] = nx.DiGraph,
  ):
      """
      :param graph: Optional graph object to be used as causal graph.
      :param graph_copier: Optional function that can copy a causal graph. Defaults to a networkx.DiGraph
                           constructor.
      """
      # Todo: Remove after https://github.com/py-why/dowhy/pull/943.
      from dowhy.causal_graph import CausalGraph
      from dowhy.causal_model import CausalModel
  
      if graph is None:
          graph = nx.DiGraph()
      elif isinstance(graph, CausalModel):
          graph = graph_copier(graph._graph._graph)
      elif isinstance(graph, CausalGraph):
          graph = graph_copier(graph._graph)
  
      self.graph = graph
      self.graph_copier = graph_copier
  
imports: from typing import Any, Callable, Optional, Union
  import networkx
  from dowhy.gcm.causal_mechanisms import ConditionalStochasticModel, FunctionalCausalModel, InvertibleFunctionalCausalModel, StochasticModel
  from dowhy.graph import DirectedGraph, HasNodes, get_ordered_predecessors, is_root_node, validate_acyclic, validate_node_in_graph
label_desc: Use image node_id 1 to create a new ProbabilisticCausalModel object  with example: obj = ProbabilisticCausalModel(graph, graph_copier)