code: def test_variance(dist):
      analytic_var = dist.variance
      num_samples = 500000
      sample_var = dist.sample((num_samples,)).var(0)
      assert_close(sample_var, analytic_var, rtol=0.01)
  
file_path: pyro/tests/distributions/test_conjugate.py
imports: import math
  import pytest
  import torch
  import pyro.distributions
  from pyro.distributions import BetaBinomial, DirichletMultinomial, GammaPoisson
  from tests.common import assert_close
label_desc: Use image node_id 2 for calling a global function with example usage: test_variance(dist) without return types