code: def _sample_count_from_latent(
      eta: np.ndarray,
      root_node: bool,
      zero_inflation_pct: float = 0.05,
  ) -> np.ndarray:
      """
      Samples a zero-inflated poisson distribution.
      Returns:
          Samples from a Poisson distribution.
      Raises:
          ValueError: Unsupported zero-inflation factor.
      """
      if (
          not isinstance(zero_inflation_pct, (float, int))
          or zero_inflation_pct < 0
          or zero_inflation_pct > 1
      ):
          raise ValueError(
              "Unsupported zero-inflation factor, distribution['count'] needs to be a float in [0, 1]"
          )
      n_samples = eta.shape[0]
  
      # add noise manually if root node
      # uniform [0, 1] makes sure that the counts are small
      if root_node:
          eta += np.random.uniform(size=n_samples)
  
      zif = np.random.uniform(size=n_samples) < zero_inflation_pct
      count = _sample_poisson(expected_count=_exp_relu(eta))
  
      # inflate the zeros:
      count[zif] = 0
      return count
  
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 6 for calling a global function with example usage: _sample_count_from_latent(eta, root_node, zero_inflation_pct) and returns: count