code: def _compute_p_value(
      data: pd.DataFrame,
      X: Union[List, str],
      Y: Union[List, str],
      Z: Optional[Union[Set, List, str]],
      independence_test: Optional[
          Callable[[np.ndarray, np.ndarray], float]
      ],
      conditional_independence_test: Optional[
          Callable[[np.ndarray, np.ndarray, np.ndarray], float]
      ],
      seed: int,
  ) -> float:
      """Perform (conditional) independence test and report p-value.
  
      If any nodes needed for the test do not exist in the data, this test is skipped and a value of -1 is returned and a
      warning is raised.
  
      :param data: Observations of variables in the DAG.
      :param X: Variable to test (conditional) independence with Y
      :param Y: Variable to test (conditional) independence with X
      :param Z: Set to condition independence test on. Can be empty (None, empty set, or empty list).
      :param independence_test: Independence test to use.
      :param conditional_independence_test: Conditional independence test to use.
      :param seed: Random seed
      :return: p-value
      """
      set_random_seed(seed)
  
      # Test if we have data for X and Y
      for node in [X, Y]:
          if not node in data.columns:
              warnings.warn(
                  f"WARN: Couldn't find data for node {node}. Skip this test."
              )
              return
  
      if Z:
          # Test if we have data for Z
          for node in Z:
              if not node in data.columns:
                  warnings.warn(
                      f"WARN: Couldn't find data for node {node}. Skip this test."
                  )
                  return
          p_value = conditional_independence_test(
              data[X].values, data[Y].values, data[Z].values
          )
      else:
          p_value = independence_test(data[X].values, data[Y].values)
      return p_value
  
imports: import warnings
  from dataclasses import dataclass, field
  from enum import Enum, auto
  from functools import partial
  from inspect import getfullargspec
  from itertools import permutations
  from typing import Any, Callable, Dict, FrozenSet, List, Optional, Set, Tuple, Union
  import matplotlib.colors
  import matplotlib.pyplot
  import networkx
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from tqdm import tqdm
  import dowhy.gcm.config
  from dowhy.gcm.independence_test import kernel_based
  from dowhy.gcm.util import plot
  from dowhy.gcm.util.general import set_random_seed
  from dowhy.graph import DirectedGraph, get_ordered_predecessors
label_desc: Use image node_id 11 for calling a global function with example usage: _compute_p_value(data, X, Y, Z, independence_test, conditional_independence_test, seed) and returns: p_value