code: def write_data(output, iterable):
      """Write (index, data) iterable to `output`
  
      Write some data to `output`. Iterable should return 2-tuples of the form
      index, data such that::
  
          output[index] = data
  
      makes sense.
  
      Examples
      --------
      >>> a=np.zeros((2,2))
      >>> write_data(a, data_generator(np.asarray([[1,2],[3,4]])))
      >>> a
      array([[ 1.,  2.],
             [ 3.,  4.]])
      """
      for index, data in iterable:
          output[index] = data
  
file_path: nipy/nipy/core/utils/generators.py
imports: import numpy
  from nipy.utils import seq_prod
label_desc: Use image node_id 3 for calling a global function with example usage: write_data(output, iterable) without return types