code: def test_roots_genlaguerre():
      def rootf(a):
          return lambda n, mu: sc.roots_genlaguerre(n, a, mu)
  
      def evalf(a):
          return lambda n, x: sc.eval_genlaguerre(n, a, x)
  
      def weightf(a):
          return lambda x: x**a * np.exp(-x)
  
      vgq = verify_gauss_quad
      vgq(rootf(-0.5), evalf(-0.5), weightf(-0.5), 0.0, np.inf, 5)
      vgq(
          rootf(-0.5),
          evalf(-0.5),
          weightf(-0.5),
          0.0,
          np.inf,
          25,
          atol=1e-13,
      )
      vgq(
          rootf(-0.5),
          evalf(-0.5),
          weightf(-0.5),
          0.0,
          np.inf,
          100,
          atol=1e-12,
      )
  
      vgq(rootf(0.1), evalf(0.1), weightf(0.1), 0.0, np.inf, 5)
      vgq(
          rootf(0.1),
          evalf(0.1),
          weightf(0.1),
          0.0,
          np.inf,
          25,
          atol=1e-13,
      )
      vgq(
          rootf(0.1),
          evalf(0.1),
          weightf(0.1),
          0.0,
          np.inf,
          100,
          atol=1.6e-13,
      )
  
      vgq(rootf(1), evalf(1), weightf(1), 0.0, np.inf, 5)
      vgq(rootf(1), evalf(1), weightf(1), 0.0, np.inf, 25, atol=1e-13)
      vgq(
          rootf(1),
          evalf(1),
          weightf(1),
          0.0,
          np.inf,
          100,
          atol=1.03e-13,
      )
  
      vgq(rootf(10), evalf(10), weightf(10), 0.0, np.inf, 5)
      vgq(
          rootf(10), evalf(10), weightf(10), 0.0, np.inf, 25, atol=1e-13
      )
      vgq(
          rootf(10),
          evalf(10),
          weightf(10),
          0.0,
          np.inf,
          100,
          atol=1e-12,
      )
  
      vgq(rootf(50), evalf(50), weightf(50), 0.0, np.inf, 5)
      vgq(
          rootf(50), evalf(50), weightf(50), 0.0, np.inf, 25, atol=1e-13
      )
      vgq(
          rootf(50),
          evalf(50),
          weightf(50),
          0.0,
          np.inf,
          100,
          rtol=1e-14,
          atol=2e-13,
      )
  
      x, w = sc.roots_genlaguerre(5, 2, False)
      y, v, m = sc.roots_genlaguerre(5, 2, True)
      assert_allclose(x, y, 1e-14, 1e-14)
      assert_allclose(w, v, 1e-14, 1e-14)
  
      muI, muI_err = integrate.quad(weightf(2.0), 0.0, np.inf)
      assert_allclose(m, muI, rtol=muI_err)
  
      assert_raises(ValueError, sc.roots_genlaguerre, 0, 2)
      assert_raises(ValueError, sc.roots_genlaguerre, 3.3, 2)
      assert_raises(ValueError, sc.roots_genlaguerre, 3, -1.1)
  
imports: import numpy
  from numpy import array, sqrt
  from numpy.testing import assert_array_almost_equal, assert_equal, assert_almost_equal, assert_allclose
  from pytest import raises
  from scipy import integrate
  import scipy.special
  from scipy.special import gamma
  import scipy.special._orthogonal
label_desc: Use image node_id 18 for calling a global function with example usage: test_roots_genlaguerre() and returns: function, function, function