code: def test_binomial_approx_log_prob(tol):
      logits = torch.linspace(-10.0, 10.0, 100)
      k = torch.arange(100.0).unsqueeze(-1)
      n_minus_k = torch.arange(100.0).unsqueeze(-1).unsqueeze(-1)
      n = k + n_minus_k
  
      expected = torch.distributions.Binomial(
          n, logits=logits
      ).log_prob(k)
      with set_approx_log_prob_tol(tol):
          actual = dist.Binomial(n, logits=logits).log_prob(k)
  
      assert_close(actual, expected, atol=tol)
  
file_path: pyro/tests/distributions/test_binomial.py
imports: import pytest
  import torch
  import pyro.distributions
  from pyro.contrib.epidemiology.distributions import set_approx_log_prob_tol, set_approx_sample_thresh
  from tests.common import assert_close
label_desc: Use image node_id 3 for calling a global function with example usage: test_binomial_approx_log_prob(tol) without return types