code: def test_sample_count_from_latent_zero_inflation(
      poisson_lambda, zero_inflation_pct
  ):
      """
      We test whether the zero-inflation is functional using the first two moments.
      """
      sample = _sample_count_from_latent(
          np.ones(shape=10000) * poisson_lambda,
          zero_inflation_pct=zero_inflation_pct,
          root_node=False,
      )
      if poisson_lambda < 0:
          poisson_lambda = np.exp(poisson_lambda)
  
      tol = 0.1
      assert np.isclose(
          sample.mean(),
          (1 - zero_inflation_pct) * poisson_lambda,
          atol=0,
          rtol=tol,
      )
      assert np.isclose(
          sample.var(),
          (1 + zero_inflation_pct * poisson_lambda)
          * (1 - zero_inflation_pct)
          * poisson_lambda,
          atol=0,
          rtol=tol,
      )
  
imports: import operator
  from typing import Hashable, Tuple, Union
  import networkx
  import numpy
  import pandas
  import pytest
  from networkx.algorithms.dag import is_directed_acyclic_graph
  from sklearn.gaussian_process.kernels import RBF
  from causalnex.structure.data_generators.core import _sample_binary_from_latent, _sample_count_from_latent, _sample_poisson, generate_structure, nonlinear_sem_generator, sem_generator
  from causalnex.structure.structuremodel import StructureModel
label_desc: Use image node_id 6 for calling a global function with example usage: test_sample_count_from_latent_zero_inflation(poisson_lambda, zero_inflation_pct) without return types