code: def train_model_idx(train_model) -> BayesianModel:
      """
      This Bayesian model is identical to the train_model() fixture, with the exception that node names
      are integers from zero to 1, mapped by:
  
      {"a": 0, "b": 1, "c": 2, "d": 3, "e": 4}
      """
      model = BayesianModel()
      idx_map = {"a": 0, "b": 1, "c": 2, "d": 3, "e": 4}
      model.add_edges_from(
          [(idx_map[u], idx_map[v]) for u, v in train_model.edges]
      )
      return model
  
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 2 for calling a global function with example usage: train_model_idx(train_model) and returns: model