code: def test_sample(loc, concentration, n_samples=int(1e6), n_iter=50):
      prob = VonMises(loc, concentration)
      samples = prob.sample((n_samples,))
      mu, kappa = _fit_params_from_samples(samples, n_iter=n_iter)
      assert abs(loc - mu) < 0.1
      assert abs(concentration - kappa) < concentration * 0.1
  
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 4 for calling a global function with example usage: test_sample(loc, concentration, n_samples, n_iter) without return types