code: def unbroadcast(x, target_meta, broadcast_idx=0):
      target_shape, target_ndim, dtype, target_iscomplex = target_meta
      while anp.ndim(x) > target_ndim:
          x = anp.sum(x, axis=broadcast_idx)
      for axis, size in enumerate(target_shape):
          if size == 1:
              x = anp.sum(x, axis=axis, keepdims=True)
      if anp.iscomplexobj(x) and not target_iscomplex:
          x = anp.real(x)
      return x
  
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 39 for calling a global function with example usage: unbroadcast(x, target_meta, broadcast_idx) and returns: x