code: def get_avg_auc_lvs(
      df: pd.DataFrame,
      bn: BayesianNetwork,
      lv_states: List,
      n_splits: int = 5,
      seed: int = 2021,
      markov_blanket: bool = False,
      n_cpus: int = multiprocessing.cpu_count() - 1,
  ) -> float:
      """
      Utility function to compute AUC using only the parent nodes
  
      Args:
          df: Input dataframe
          bn: Bayesian network
          lv_states: the states the LV can assume
          n_splits: Number of cross-validation folds
          seed: Random seed number
          markov_blanket: Whether we predict only using the Markov blanket
          n_cpus: Number of CPU cores to use
  
      Returns:
          Average AUC
      """
      cv = KFold(n_splits=n_splits, shuffle=True, random_state=seed)
      total_auc = 0
  
      for fold, (train_idx, test_idx) in enumerate(cv.split(df)):
          t0 = time()
          train_df = df.loc[train_idx, :]
          test_df = df.loc[test_idx, :]
          bn.fit_latent_cpds("LV", lv_states, train_df, n_runs=30)
          chunks = [
              [bn, test_df, target, markov_blanket]
              for target in bn.nodes
              if target != "LV"
          ]
          with multiprocessing.Pool(n_cpus) as p:
              result = p.starmap(_compute_auc_lv_stub, chunks)
  
          total_auc += sum(result) / (len(bn.nodes) - 1)
          print(
              f"Processing fold {fold} using {n_cpus} cores takes {time() - t0} seconds"
          )
  
      return total_auc / n_splits
  
imports: import json
  import multiprocessing
  import os
  import warnings
  from collections import defaultdict
  from time import time
  from typing import List, Tuple
  import dataframe_image
  import networkx
  import numpy
  import pandas
  from IPython.core.display import display
  from IPython.display import Image
  from sklearn import metrics
  from sklearn.model_selection import KFold
  from causalnex.evaluation import roc_auc
  from causalnex.inference import InferenceEngine
  from causalnex.network import BayesianNetwork
  from causalnex.plots import plot_structure
  from causalnex.structure import StructureModel
label_desc: Use image node_id 10 for calling a global function with example usage: get_avg_auc_lvs(df, bn, lv_states, n_splits, seed, markov_blanket, n_cpus) and returns: unknown