code: def scatter(indices, array, new_dims, like=None):
      """Scatters an array into a tensor of shape new_dims according to indices.
  
      This operation is similar to scatter_element_add, except that the tensor
      is zero-initialized. Calling scatter(indices, array, new_dims) is identical
      to calling scatter_element_add(np.zeros(new_dims), indices, array)
  
      Args:
          indices (tensor_like[int]): Indices to update
          array (tensor_like[float]): Values to assign to the new tensor
          new_dims (int or tuple[int]): The shape of the new tensor
          like (str): Manually chosen interface to dispatch to.
      Returns:
          tensor_like[float]: The tensor with the values modified the given indices.
  
      **Example**
  
      >>> indices = np.array([4, 3, 1, 7])
      >>> updates = np.array([9, 10, 11, 12])
      >>> shape = 8
      >>> qml.math.scatter(indices, updates, shape)
      array([ 0, 11,  0, 10,  9,  0,  0, 12])
      """
      return np.scatter(indices, array, new_dims, like=like)
  
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 17 for calling a global function with example usage: scatter(indices, array, new_dims, like) and returns: np