code: def train_data() -> pd.DataFrame:
      """
      Training data for testing Bayesian Networks. There are 98 samples, with 5 columns:
  
      - a: {"a", "b", "c", "d"}
      - b: {"x", "y", "z"}
      - c: 0.0 - 100.0
      - d: Boolean
      - e: Boolean
  
      This data was generated by constructing the Bayesian Model train_model(), and then sampling
      from this structure. Since e and d are both independent of all other nodes, these were sampled first for
      each row (form their respective pre-defined distributions). This then allows the sampling of all further
      variables based on their conditional dependencies.
  
      The approximate distributions used to sample from can be viewed by inspecting train_data_cpds().
  
      """
  
      data_arr = [
          ["a", "x", 73.78658346945414, False, False],
          ["d", "x", 12.765853213346603, False, False],
          ["c", "y", 22.43657132589221, False, False],
          ["a", "x", 4.267744937038964, False, False],
          ["b", "x", 62.87087344904927, False, False],
          ["c", "x", 31.55295196889971, False, False],
          ["a", "x", 37.403388911083965, False, False],
          ["b", "x", 63.171968604247155, False, False],
          ["d", "x", 11.140539452118263, False, False],
          ["d", "x", 0.1555338799942385, True, False],
          ["c", "x", 9.269926225399187, False, True],
          ["b", "z", 75.38846241765208, True, True],
          ["c", "z", 33.10212378889936, False, True],
          ["b", "z", 57.04657630213301, True, True],
          ["b", "x", 72.03855905511072, True, False],
          ["c", "x", 5.106018765399956, False, False],
          ["c", "z", 5.802617702038839, False, True],
          ["c", "x", 17.22538330530506, False, False],
          ["a", "y", 87.05395007052729, False, False],
          ["d", "y", 19.09989481093348, False, False],
          ["c", "x", 4.313272835124353, True, False],
          ["b", "x", 13.660704178900938, True, True],
          ["b", "x", 7.693287813764131, False, False],
          ["c", "y", 32.791770073523246, False, False],
          ["c", "y", 12.039098492465282, False, False],
          ["a", "x", 51.97718339128754, False, False],
          ["d", "x", 8.393970656769238, False, False],
          ["a", "x", 0.3610815726384886, False, False],
          ["a", "y", 35.31788713900731, True, False],
          ["b", "x", 35.84702992379284, False, True],
          ["c", "y", 32.872350426703356, True, False],
          ["a", "x", 21.218746335586868, False, True],
          ["b", "y", 71.5495653029006, True, False],
          ["c", "x", 15.393846082097575, False, False],
          ["d", "y", 4.514559208625406, False, False],
          ["d", "x", 0.704928173400301, False, False],
          ["c", "y", 34.10829794112354, True, False],
          ["d", "x", 6.84602512195673, False, False],
          ["b", "y", 25.43743439885204, False, False],
          ["d", "x", 7.544831467091971, False, False],
          ["d", "x", 13.923699372025073, False, False],
          ["b", "x", 21.493005760070915, False, False],
          ["a", "x", 41.353977640369436, False, False],
          ["c", "z", 10.015835005248583, True, True],
          ["c", "z", 29.40115954319444, False, True],
          ["c", "x", 17.305145945035388, False, False],
          ["b", "x", 57.3687951851441, False, False],
          ["a", "x", 59.31395756039643, False, False],
          ["d", "x", 19.557939187075984, False, False],
          ["d", "y", 15.739556224725082, False, False],
          ["c", "x", 6.850626809845993, True, False],
          ["c", "x", 7.774579861173826, False, False],
          ["c", "x", 20.807136344297092, True, False],
          ["b", "y", 29.406207780312343, False, False],
          ["a", "x", 34.38851648220974, False, False],
          ["d", "x", 1.0951104244381218, True, False],
          ["c", "x", 37.27483338042188, False, False],
          ["b", "x", 15.745994603442064, False, False],
          ["c", "x", 17.78180189764816, False, True],
          ["a", "x", 17.067548428231493, True, False],
          ["c", "x", 26.857320012899727, False, False],
          ["a", "x", 41.0038510689549, False, True],
          ["d", "x", 0.2299684913699096, False, True],
          ["a", "x", 57.35885570158893, True, False],
          ["d", "x", 12.40118443712448, False, False],
          ["c", "x", 22.624550487374112, False, False],
          ["a", "x", 93.08587619178269, False, False],
          ["b", "y", 18.33030505634329, False, False],
          ["a", "z", 64.29945681859853, False, True],
          ["b", "x", 73.66024742961967, False, False],
          ["b", "x", 16.717397443478287, False, True],
          ["c", "y", 4.642615342125205, False, True],
          ["c", "x", 9.431345661106931, False, False],
          ["c", "y", 31.76238774237109, False, False],
          ["c", "y", 3.6961806894707965, False, False],
          ["d", "y", 2.298895066631253, True, False],
          ["d", "y", 13.222298172220462, False, False],
          ["c", "x", 28.301638775451153, False, False],
          ["d", "x", 7.702270580869413, True, False],
          ["a", "y", 41.38492280508702, True, False],
          ["d", "x", 13.047815503255656, True, False],
          ["c", "x", 22.14641490202623, False, False],
          ["b", "z", 43.13007970158368, False, True],
          ["b", "x", 60.09518672623882, True, False],
          ["a", "x", 79.6370082234198, False, False],
          ["d", "x", 16.60880504367762, False, False],
          ["a", "z", 22.88783470451029, False, True],
          ["a", "x", 33.66416643964188, False, False],
          ["b", "y", 69.91787304290465, True, True],
          ["c", "x", 31.941092922567663, True, False],
          ["d", "x", 16.739638908154518, False, False],
          ["a", "z", 11.129589373273108, False, True],
          ["d", "y", 4.96943558614434, True, False],
          ["d", "y", 6.585354730457387, False, False],
          ["d", "x", 9.859942318446954, False, False],
          ["b", "z", 18.541485302271496, False, True],
          ["a", "x", 87.53473074574995, True, False],
          ["a", "z", 59.61068083691302, False, True],
      ]
  
      data = pd.DataFrame(data_arr, columns=["a", "b", "c", "d", "e"])
      return data
  
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 3 for calling a global function with example usage: train_data() and returns: data