code: def _as_mrp(quat: jax.Array) -> jax.Array:
      sign = jnp.where(quat[3] < 0, -1.0, 1.0)
      denominator = 1.0 + sign * quat[3]
      return sign * quat[:3] / denominator
  
imports: from __future__ import annotations
  import functools
  import re
  import typing
  import scipy.spatial.transform
  import jax
  import jax.numpy
  from jax._src.numpy.util import _wraps
label_desc: Use image node_id 3 for calling a global function with example usage: _as_mrp(quat) and returns: unknown