code: def _retrieve_bit(
      idx: int, bit_idx: int, int_array: ndarray
  ) -> Tuple[int, int, int]:
      """Retrieve a single bit from an integer array."""
      cur_int = int_array[idx]
      bit = ((cur_int >> (7 - bit_idx)) & 1) > 0
      idx += (bit_idx + 1) // 8
      bit_idx = jnp.mod(bit_idx + 1, 8)
  
      return bit, idx, bit_idx
  
file_path: NeuralCompression/projects/jax_entropy_coders/jax_arithmetic_coder.py
imports: from typing import Any, Callable, List, Tuple
  import jax
  import jax.lax
  import jax.numpy
  from jax.numpy import ndarray
label_desc: Use image node_id 3 for calling a global function with example usage: _retrieve_bit(idx, bit_idx, int_array) and returns: bit,  idx,  bit_idx