code: def test_von_mises_3d(scale):
      concentration = torch.randn(3)
      concentration = concentration * (scale / concentration.norm(2))
  
      num_samples = 100000
      samples = torch.randn(num_samples, 3)
      samples = samples / samples.norm(2, dim=-1, keepdim=True)
  
      d = VonMises3D(concentration, validate_args=True)
      actual_total = d.log_prob(samples).exp().mean()
      expected_total = 1 / (4 * math.pi)
      ratio = actual_total / expected_total
      assert torch.abs(ratio - 1) < 0.01, ratio
  
file_path: pyro/tests/distributions/test_von_mises.py
imports: import math
  import os
  import pytest
  import torch
  from torch import optim
  from pyro.distributions import VonMises, VonMises3D
  from pyro.distributions.testing.gof import auto_goodness_of_fit
  from tests.common import TEST_FAILURE_RATE, skipif_param, xfail_if_not_implemented
label_desc: Use image node_id 7 for calling a global function with example usage: test_von_mises_3d(scale) without return types