code: def _searchsorted(a, v):
      """Returns where `v` can be inserted so that `a` remains sorted."""
  
      def cond(state):
          low_idx, high_idx = state
          return low_idx < high_idx
  
      def body(state):
          low_idx, high_idx = state
          mid_idx = (low_idx + high_idx) // 2
          mid_v = a[mid_idx]
          low_idx = jnp.where(v > mid_v, mid_idx + 1, low_idx)
          high_idx = jnp.where(v > mid_v, high_idx, mid_idx)
          return low_idx, high_idx
  
      low_idx, _ = lax.while_loop(cond, body, (0, a.shape[-1]))
      return low_idx
  
imports: import functools
  import jax
  from jax import lax
  from jax import random
  from jax import tree_util
  import jax.numpy
label_desc: Use image node_id 13 for calling a global function with example usage: _searchsorted(a, v) and returns: low_idx, unknown, low_idx,  high_idx