code: def validate_local_structure(
      causal_graph: DirectedGraph, node: Any
  ) -> None:
      if PARENTS_DURING_FIT not in causal_graph.nodes[
          node
      ] or causal_graph.nodes[node][
          PARENTS_DURING_FIT
      ] != get_ordered_predecessors(
          causal_graph, node
      ):
          raise RuntimeError(
              "The causal mechanism of node %s is not fitted to the graphical structure! Fit all "
              "causal models in the graph first. If the mechanism is already fitted based on the causal "
              "parents, consider to update the persisted parents for that node manually."
              % 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 6 for calling a global function with example usage: validate_local_structure(causal_graph, node) without return types