code: def create_cpds(data, pc=0):
      df = data.copy(deep=True)  # type: pd.DataFrame
  
      df_vals = {col: list(df[col].unique()) for col in df.columns}
      for _, vals in df_vals.items():
          vals.sort()
  
      cpd_a = np.array(
          [
              [
                  (
                      len(
                          df[
                              (df["a"] == a)
                              & (df["b"] == b)
                              & (df["d"] == d)
                          ]
                      )
                      + pc
                  )
                  / (
                      len(df[(df["b"] == b) & (df["d"] == d)])
                      + (pc * len(df_vals["a"]))
                  )
                  for b in df_vals["b"]
                  for d in df_vals["d"]
              ]
              for a in df_vals["a"]
          ]
      )
  
      cpd_b = np.array(
          [
              [
                  (
                      len(
                          df[
                              (df["b"] == b)
                              & (df["d"] == d)
                              & (df["e"] == e)
                          ]
                      )
                      + pc
                  )
                  / (
                      len(df[(df["d"] == d) & (df["e"] == e)])
                      + (pc * len(df_vals["b"]))
                  )
                  for d in df_vals["d"]
                  for e in df_vals["e"]
              ]
              for b in df_vals["b"]
          ]
      )
  
      cpd_c = np.array(
          [
              [
                  (
                      (
                          len(
                              df[
                                  (df["c"] == c)
                                  & (df["b"] == b)
                                  & (df["d"] == d)
                                  & (df["e"] == e)
                              ]
                          )
                          + pc
                      )
                      / (
                          len(
                              df[
                                  (df["b"] == b)
                                  & (df["d"] == d)
                                  & (df["e"] == e)
                              ]
                          )
                          + (pc * len(df_vals["c"]))
                      )
                  )
                  if not df[
                      (df["b"] == b) & (df["d"] == d) & (df["e"] == e)
                  ].empty
                  else (1 / len(df_vals["c"]))
                  for b in df_vals["b"]
                  for d in df_vals["d"]
                  for e in df_vals["e"]
              ]
              for c in df_vals["c"]
          ]
      )
  
      cpd_d = np.array(
          [
              [
                  (len(df[df["d"] == d]) + pc)
                  / (len(df) + (pc * len(df_vals["d"])))
              ]
              for d in df_vals["d"]
          ]
      )
  
      cpd_e = np.array(
          [
              [
                  (len(df[df["e"] == e]) + pc)
                  / (len(df) + (pc * len(df_vals["e"])))
              ]
              for e in df_vals["e"]
          ]
      )
  
      return {
          "a": cpd_a,
          "b": cpd_b,
          "c": cpd_c,
          "d": cpd_d,
          "e": cpd_e,
      }
  
imports: import itertools
  from typing import Dict
  import numpy
  import pandas
  import pytest
  from pgmpy.models import BayesianNetwork
  from sklearn.datasets import load_iris
  from causalnex.discretiser import Discretiser
  from causalnex.network import BayesianNetwork
  from causalnex.structure import StructureModel
  from causalnex.structure.notears import from_pandas
label_desc: Use image node_id 9 for calling a global function with example usage: create_cpds(data, pc) and returns: dict