code: def validate_node_has_causal_model(
      causal_graph: HasNodes, node: Any
  ) -> None:
      validate_node_in_graph(causal_graph, node)
  
      if CAUSAL_MECHANISM not in causal_graph.nodes[node]:
          raise ValueError(
              "Node %s has no assigned causal mechanism!" % node
          )
  
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 2 for calling a global function with example usage: validate_node_has_causal_model(causal_graph, node) without return types