code: def _init_sem_data_gen(
      graph: nx.DiGraph,
      schema: Dict,
      n_samples: int,
      default_type: str,
      distributions: Dict[str, str],
      seed: int,
  ):
      np.random.seed(seed)
  
      if not nx.algorithms.is_directed_acyclic_graph(graph):
          raise ValueError("Provided graph is not a DAG.")
  
      distributions = _set_default_distributions(
          distributions=distributions
      )
      validated_schema = validate_schema(
          nodes=graph.nodes(), schema=schema, default_type=default_type
      )
      var_fte_mapper = VariableFeatureMapper(validated_schema)
  
      # pre-allocate array
      n_columns = var_fte_mapper.n_features
      x_mat = np.empty([n_samples, n_columns])
  
      return distributions, var_fte_mapper, x_mat
  
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 13 for calling a global function with example usage: _init_sem_data_gen(graph, schema, n_samples, default_type, distributions, seed) and returns: distributions,  var_fte_mapper,  x_mat