code: def chi2sf(x, s):
      r"""
      This function returns the survival function of the chi^2
      distribution. The survival function is given as:
  
      .. math::
         1 - CDF
  
      where rhe chi^2 CDF is given as
  
      .. math::
         F(x; s) = \frac{ \gamma( x/2, s/2 ) }{ \Gamma(s/2) },
  
      with :math:`\gamma` is the incomplete gamma function defined above.
      Therefore, the survival probability is givne by:
  
      .. math::
         1 - \frac{ \gamma( x/2, s/2 ) }{ \Gamma(s/2) }.
  
      This function matches the results from
      scipy to numerical precision.
      """
      top = incomplete_gamma(x / 2, s / 2)
      bottom = math.gamma(s / 2)
      value = top / bottom
      return 1 - value
  
imports: import math
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: chi2sf(x, s) and returns: unknown