class_docstr: Check that the eval_* functions agree with the constructed polynomials
class_docstr_tok: ["Check","that","the","eval_","*","functions","agree","with","the","constructed","polynomials"]
code: def check_poly(
      self,
      func,
      cls,
      param_ranges=[],
      x_range=[],
      nn=10,
      nparam=10,
      nx=10,
      rtol=1e-8,
  ):
      np.random.seed(1234)
  
      dataset = []
      for n in np.arange(nn):
          params = [
              a + (b - a) * np.random.rand(nparam)
              for a, b in param_ranges
          ]
          params = np.asarray(params).T
          if not param_ranges:
              params = [0]
          for p in params:
              if param_ranges:
                  p = (n,) + tuple(p)
              else:
                  p = (n,)
              x = x_range[0] + (
                  x_range[1] - x_range[0]
              ) * np.random.rand(nx)
              x[0] = x_range[0]  # always include domain start point
              x[1] = x_range[1]  # always include domain end point
              poly = np.poly1d(cls(*p).coef)
              z = np.c_[np.tile(p, (nx, 1)), x, poly(x)]
              dataset.append(z)
  
      dataset = np.concatenate(dataset, axis=0)
  
      def polyfunc(*p):
          p = (p[0].astype(np.dtype("long")),) + p[1:]
          return func(*p)
  
      with np.errstate(all="raise"):
          ds = FuncData(
              polyfunc,
              dataset,
              list(range(len(param_ranges) + 2)),
              -1,
              rtol=rtol,
          )
          ds.check()
  
imports: import numpy
  from numpy.testing import assert_, assert_allclose
  import pytest
  from scipy.special import _ufuncs
  import scipy.special._orthogonal
  from scipy.special._testutils import FuncData
label_desc: Use image node_id 1 for calling the TestPolys obj's underlying member method code with example usage: obj.check_poly(func, cls, param_ranges, x_range, nn, nparam, nx, rtol) and returns: func