code: def rational_interpolate(data, degnum, X=symbols("x")):
      """
      Returns a rational interpolation, where the data points are element of
      any integral domain.
  
      The first argument  contains the data (as a list of coordinates). The
      ``degnum`` argument is the degree in the numerator of the rational
      function. Setting it too high will decrease the maximal degree in the
      denominator for the same amount of data.
  
      Examples
      ========
  
      >>> from sympy.polys.polyfuncs import rational_interpolate
  
      >>> data = [(1, -210), (2, -35), (3, 105), (4, 231), (5, 350), (6, 465)]
      >>> rational_interpolate(data, 2)
      (105*x**2 - 525)/(x + 1)
  
      Values do not need to be integers:
  
      >>> from sympy import sympify
      >>> x = [1, 2, 3, 4, 5, 6]
      >>> y = sympify("[-1, 0, 2, 22/5, 7, 68/7]")
      >>> rational_interpolate(zip(x, y), 2)
      (3*x**2 - 7*x + 2)/(x + 1)
  
      The symbol for the variable can be changed if needed:
      >>> from sympy import symbols
      >>> z = symbols('z')
      >>> rational_interpolate(data, 2, X=z)
      (105*z**2 - 525)/(z + 1)
  
      References
      ==========
  
      .. [1] Algorithm is adapted from:
             http://axiom-wiki.newsynthesis.org/RationalInterpolation
  
      """
      from sympy.matrices.dense import ones
  
      xdata, ydata = list(zip(*data))
  
      k = len(xdata) - degnum - 1
      if k < 0:
          raise OptionError("Too few values for the required degree.")
      c = ones(degnum + k + 1, degnum + k + 2)
      for j in range(max(degnum, k)):
          for i in range(degnum + k + 1):
              c[i, j + 1] = c[i, j] * xdata[i]
      for j in range(k + 1):
          for i in range(degnum + k + 1):
              c[i, degnum + k + 1 - j] = -c[i, k - j] * ydata[i]
      r = c.nullspace()[0]
      return sum(r[i] * X**i for i in range(degnum + 1)) / sum(
          r[i + degnum + 1] * X**i for i in range(k + 1)
      )
  
file_path: sympy/sympy/polys/polyfuncs.py
imports: from sympy.core import S, Basic, symbols, Dummy
  from sympy.polys.polyerrors import PolificationFailed, ComputationFailed, MultivariatePolynomialError, OptionError
  from sympy.polys.polyoptions import allowed_flags, build_options
  from sympy.polys.polytools import poly_from_expr, Poly
  from sympy.polys.specialpolys import symmetric_poly, interpolating_poly
  from sympy.polys.rings import sring
  from sympy.utilities import numbered_symbols, take, public
label_desc: Use image node_id 4 for calling a global function with example usage: rational_interpolate(data, degnum, X) and returns: unknown