code: def evaluateBetaSpline(self, beta1, beta2, expected, plot=False):
      n = 11
      nsample = 4
      x = [float(i) for i in range(n)]
      y = [sin(2.0 * pi * float(i) / float(n - 1)) for i in x]
      found = []
      newx = []
      betaspline = Spline(
          xPoints=x, yPoints=y, beta1=beta1, beta2=beta2, type="beta"
      )
  
      k = 0
      for i in range(n + 1):
          if not i:
              tlo = x[0] - 0.5 * (x[1] - x[0])
              thi = x[0]
              jhi = nsample - 1
          elif i < n:
              tlo = x[i - 1]
              thi = x[i]
              jhi = nsample - 1
          elif i >= n:
              tlo = x[n - 1]
              thi = x[n - 1] + 0.5 * (x[n - 1] - x[n - 2])
              jhi = nsample
          for j in range(jhi + 1):
              xval = ((nsample - j) * tlo + j * thi) / float(nsample)
              newx.append(xval)
              yval = betaspline(xval)
              found.append(yval)
              # when the value is very small the precision error goes pretty
              # high up to 0.5, we skip them ... this is probably due to the
              # double to real conversion in essentia as the expected values were
              # computed with double precission
              if yval > 5e-16:
                  self.assertAlmostEqual(expected[k], yval, 5e-6)
              k += 1
      if plot:
          from pylab import plot, show, legend
  
          plot(newx, found, label="found")
          plot(newx, expected, label="expected")
          legend()
          show()
  
file_path: essentia/test/src/unittests/standard/test_spline.py
imports: from essentia_test import *
  from essentia.standard import *
  from numpy import r_, sin, pi
label_desc: Use image node_id 3 for calling the TestSpline obj's underlying member method code with example usage: obj.evaluateBetaSpline(beta1, beta2, expected, plot) without return types