code: def invert_permutation(i: Array) -> Array:
      """Helper function that inverts a permutation array."""
      return (
          jnp.empty_like(i).at[i].set(jnp.arange(i.size, dtype=i.dtype))
      )
  
file_path: jax/jax/_src/scipy/stats/_core.py
imports: from __future__ import annotations
  from collections import namedtuple
  from functools import partial
  import math
  import jax
  import jax.numpy
  from jax import jit
  from jax._src import dtypes
  from jax._src.api import vmap
  from jax._src.numpy.util import check_arraylike, _wraps, promote_args_inexact
  from jax._src.typing import ArrayLike, Array
  from jax._src.util import canonicalize_axis
  import scipy
label_desc: Use image node_id 2 for calling a global function with example usage: invert_permutation(i) and returns: jnp