code: def repeat_to_match_shape(g, shape, dtype, axis, keepdims):
      """Returns the array g repeated along axis to fit vector space vs.
      Also returns the number of repetitions of the array."""
      if shape == ():
          return g, 1
      axis = list(axis) if isinstance(axis, tuple) else axis
      new_shape = onp.array(shape)
      new_shape[axis] = 1
      num_reps = onp.prod(onp.array(shape)[axis])
      # Can't use broadcast_to because of numpy bug: https://github.com/numpy/numpy/issues/9165
      # return anp.broadcast_to(anp.reshape(g, new_shape), shape), num_reps
      return (
          anp.reshape(g, new_shape) + onp.zeros(shape, dtype=dtype),
          num_reps,
      )
  
imports: from __future__ import absolute_import
  from six import string_types
  from functools import partial
  import numpy
  from ..util import func
  from .None import numpy_wrapper
  from .numpy_boxes import ArrayBox
  from autograd.extend import primitive, vspace, defvjp, defvjp_argnum, SparseObject, VJPNode, register_notrace
label_desc: Use image node_id 8 for calling a global function with example usage: repeat_to_match_shape(g, shape, dtype, axis, keepdims) and returns: unknown,  num_reps, g,  int