code: def generate_count_dataframe(
      sm: nx.DiGraph,
      n_samples: int,
      zero_inflation_factor: float = 0.1,
      intercept: bool = False,
      seed: int = None,
      kernel: Optional[Kernel] = None,
  ) -> pd.DataFrame:
      """
      Generates a dataframe with samples from SEM with specified type of noise.
  
      Args:
          sm: A DAG in form of a networkx or StructureModel. Does not require weights.
          n_samples: The number of rows/observations to sample.
          kernel: A kernel from sklearn.gaussian_process.kernels like RBF(1) or
              Matern(1) or any combinations thereof. The kernels are used to
              create the latent variable for the binary / categorical variables
              and are directly used for continuous variables.
          zero_inflation_factor: The probability of zero inflation for count data.
          intercept: Whether to use an intercept for the latent variable of each feature.
          seed: Random state
      Returns:
          x_mat: [n_samples, d_nodes] sample matrix
      Raises:
          ValueError: if ``zero_inflation_factor`` is not a float in [0, 1].
      """
  
      if kernel is None:
          return sem_generator(
              graph=sm,
              default_type="count",
              n_samples=n_samples,
              distributions={"count": zero_inflation_factor},
              noise_std=1,  # not used for poisson
              intercept=intercept,
              seed=seed,
          )
  
      return nonlinear_sem_generator(
          graph=sm,
          kernel=kernel,
          default_type="count",
          n_samples=n_samples,
          distributions={"count": zero_inflation_factor},
          noise_std=1,  # not used for poisson
          seed=seed,
      )
  
file_path: causalnex/causalnex/structure/data_generators/wrappers.py
imports: import warnings
  from typing import List, Optional, Tuple
  import networkx
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.gaussian_process.kernels import Kernel
  from causalnex.structure.data_generators import generate_structure, nonlinear_sem_generator, sem_generator
  from causalnex.structure.structuremodel import StructureModel
label_desc: Use image node_id 5 for calling a global function with example usage: generate_count_dataframe(sm, n_samples, zero_inflation_factor, intercept, seed, kernel) and returns: nonlinear_sem_generator, sem_generator