code: def _evaluate_intervention(
      node: Any,
      interventions: Dict[Any, Callable[[np.ndarray], np.ndarray]],
      pre_intervention_data: np.ndarray,
  ) -> np.ndarray:
      # Check if we need to apply an intervention on the given node.
      if node in interventions:
          # Apply intervention function to the data of the node.
          post_intervention_data = np.array(
              list(map(interventions[node], pre_intervention_data))
          )
  
          # Check if the intervention function changes the shape of the data.
          if (
              pre_intervention_data.shape
              != post_intervention_data.shape
          ):
              raise RuntimeError(
                  "Dimension of data corresponding to the node `%s` after intervention is different than before "
                  "intervention." % node
              )
  
          return post_intervention_data
      else:
          return pre_intervention_data
  
file_path: dowhy/dowhy/gcm/whatif.py
imports: from typing import Any, Callable, Dict, Iterable, List, Optional, Union
  import networkx
  import numpy
  import pandas
  from dowhy.gcm._noise import compute_noise_from_data
  from dowhy.gcm.causal_mechanisms import ClassifierFCM
  from dowhy.gcm.causal_models import InvertibleStructuralCausalModel, ProbabilisticCausalModel, StructuralCausalModel, validate_causal_dag
  from dowhy.gcm.fitting_sampling import draw_samples
  from dowhy.graph import DirectedGraph, get_ordered_predecessors, is_root_node, node_connected_subgraph_view, validate_node_in_graph
label_desc: Use image node_id 6 for calling a global function with example usage: _evaluate_intervention(node, interventions, pre_intervention_data) and returns: post_intervention_data, pre_intervention_data