code: def test_fit_generalized_pareto(k, sigma, n_samples=5000):
      with warnings.catch_warnings():
          warnings.filterwarnings("ignore", category=RuntimeWarning)
          from scipy.stats import genpareto
  
      X = genpareto.rvs(c=k, scale=sigma, size=n_samples)
      fit_k, fit_sigma = fit_generalized_pareto(torch.tensor(X))
      assert_equal(k, fit_k, prec=0.02)
      assert_equal(sigma, fit_sigma, prec=0.02)
  
imports: import warnings
  import pytest
  import torch
  from pyro.ops.stats import _cummin, autocorrelation, autocovariance, crps_empirical, effective_sample_size, fit_generalized_pareto, gelman_rubin, hpdi, pi, quantile, resample, split_gelman_rubin, waic
  from tests.common import assert_close, assert_equal, xfail_if_not_implemented
label_desc: Use image node_id 21 for calling a global function with example usage: test_fit_generalized_pareto(k, sigma, n_samples) without return types