code: def _compute_stacked_offsets(sizes, repeats):
      """Computes offsets to add to indices of stacked np arrays.
  
      When a set of np arrays are stacked, the indices of those from the second on
      must be offset in order to be able to index into the stacked np array. This
      computes those offsets.
  
      Args:
        sizes: A 1D sequence of np arrays of the sizes per graph.
        repeats: A 1D sequence of np arrays of the number of repeats per graph.
  
      Returns:
        The index offset per graph.
      """
      return np.repeat(np.cumsum(np.hstack([0, sizes[:-1]])), repeats)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from graph_nets import graphs
  import networkx
  import numpy
  from six.moves import range
  from six.moves import zip
label_desc: Use image node_id 4 for calling a global function with example usage: _compute_stacked_offsets(sizes, repeats) and returns: np