code: def _conditional_sample(
      x_new,
      x_old,
      f_old,
      kernel,
      cov_mat_old: np.ndarray = None,
      epsilon=0.00001,
  ):
      cov_mat_new = kernel(x_new)
      cross_cov = kernel(x_old, x_new)
      # X_no.T @ inv(X_oo):
      reg_coef = np.linalg.solve(
          cov_mat_old + epsilon * np.eye(x_old.shape[0]), cross_cov
      ).T
  
      # calculate conditional mean and cov
      cond_cov = (
          cov_mat_new - reg_coef @ cross_cov
      ) + epsilon * np.eye(x_new.shape[0])
      cond_mean = (reg_coef @ f_old).squeeze()
  
      # sample
      y_new = np.random.multivariate_normal(
          mean=cond_mean, cov=cond_cov
      ).squeeze()
      return y_new, cov_mat_new
  
imports: from typing import Dict, Hashable, List, Optional, Tuple, Union
  import networkx
  import numpy
  import pandas
  from sklearn.gaussian_process.kernels import RBF, Kernel
  from causalnex.structure import StructureModel
  from causalnex.structure.categorical_variable_mapper import VariableFeatureMapper, validate_schema
label_desc: Use image node_id 16 for calling a global function with example usage: _conditional_sample(x_new, x_old, f_old, kernel, cov_mat_old, epsilon) and returns: y_new,  cov_mat_new