class_docstr: Represents a structural causal model (SCM), as required e.g. by
  :func:`~dowhy.gcm.whatif.counterfactual_samples`. As compared to a :class:`~dowhy.gcm.cms.ProbabilisticCausalModel`,
  an SCM describes the data generation process in non-root nodes by functional causal models.
class_docstr_tok: ["Represents","a","structural","causal","model","(","SCM",")",",","as","required","e.g",".","by",":","func",":","`","~dowhy.gcm.whatif.counterfactual_samples","`",".","As","compared","to","a",":","class",":","`","~dowhy.gcm.cms.ProbabilisticCausalModel","`",",","an","SCM","describes","the","data","generation","process","in","non-root","nodes","by","functional","causal","models","."]
code: def set_causal_mechanism(
      self,
      node: Any,
      mechanism: Union[StochasticModel, FunctionalCausalModel],
  ) -> None:
      super().set_causal_mechanism(node, mechanism)
  
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 for calling the StructuralCausalModel obj's underlying member method code with example usage: obj.set_causal_mechanism(node, mechanism) without return types