code: def cdf(
      x: ArrayLike,
      df: ArrayLike,
      loc: ArrayLike = 0,
      scale: ArrayLike = 1,
  ) -> Array:
      x, df, loc, scale = promote_args_inexact(
          "chi2.cdf", x, df, loc, scale
      )
      two = _lax_const(scale, 2)
      return gammainc(
          lax.div(df, two),
          lax.clamp(
              _lax_const(x, 0),
              lax.div(
                  lax.sub(x, loc),
                  lax.mul(scale, two),
              ),
              _lax_const(x, jnp.inf),
          ),
      )
  
file_path: jax/jax/_src/scipy/stats/chi2.py
imports: import scipy.stats
  from jax import lax
  import jax.numpy
  from jax._src.lax.lax import _const
  from jax._src.numpy.util import _wraps, promote_args_inexact
  from jax._src.typing import Array, ArrayLike
  from jax.scipy.special import gammainc, gammaincc
label_desc: Use image node_id 3 for calling a global function with example usage: cdf(x, df, loc, scale) and returns: gammainc