code: def shape_generator(img, shape):
      """
      From a generator of items (i, r), return
      (i, r.reshape(shape))
      """
      for i, r in img:
          r.shape = shape
          yield i, r
  
file_path: nipy/nipy/core/utils/generators.py
imports: import numpy
  from nipy.utils import seq_prod
label_desc: Use image node_id 8 for calling a global function with example usage: shape_generator(img, shape) without return types