code: def test_zip_mean_variance(gate, rate):
      num_samples = 1000000
      zip_ = ZeroInflatedPoisson(
          torch.tensor(rate), gate=torch.tensor(gate)
      )
      s = zip_.sample((num_samples,))
      expected_mean = zip_.mean
      estimated_mean = s.mean()
      expected_std = zip_.stddev
      estimated_std = s.std()
      assert_close(expected_mean, estimated_mean, atol=1e-02)
      assert_close(expected_std, estimated_std, atol=1e-02)
  
file_path: pyro/tests/distributions/test_zero_inflated.py
imports: import math
  import pytest
  import torch
  from pyro.distributions import Delta, NegativeBinomial, Normal, Poisson, ZeroInflatedDistribution, ZeroInflatedNegativeBinomial, ZeroInflatedPoisson
  from pyro.distributions.util import broadcast_shape
  from tests.common import assert_close
label_desc: Use image node_id 4 for calling a global function with example usage: test_zip_mean_variance(gate, rate) without return types