code: def set_index(array, idx, val, like=None):
      """Set the value at a specified index in an array.
      Calls ``array[idx]=val`` and returns the updated array unless JAX.
  
      Args:
          array (tensor_like): array to be modified
          idx (int, tuple): index to modify
          val (int, float): value to set
  
      Returns:
          a new copy of the array with the specified index updated to ``val``.
  
      Whether the original array is modified is interface-dependent.
  
      .. note:: TensorFlow EagerTensor does not support item assignment
      """
      if like == "jax":
          from jax import numpy as jnp
  
          # ensure array is jax array (interface may be jax because of idx or val and not array)
          jax_array = jnp.array(array)
          return jax_array.at[idx].set(val)
  
      array[idx] = val
      return array
  
imports: import functools
  from collections.abc import Sequence
  import autoray
  import numpy
  from autograd.numpy.numpy_boxes import ArrayBox
  from autoray import numpy
  from numpy import ndarray
  from .None import single_dispatch
  from .utils import cast, cast_like, get_interface, requires_grad
label_desc: Use image node_id 28 for calling a global function with example usage: set_index(array, idx, val, like) and returns: array, jax_array