code: def normalize(a):
      def replace_zeros(a):
          return np.where(a > 0.0, a, 1.0)
  
      return a / replace_zeros(a.sum(-1, keepdims=True))
  
file_path: autograd/examples/hmm_em.py
imports: from __future__ import division, print_function
  import autograd.numpy
  import autograd.numpy.random
  from autograd.scipy.special import logsumexp
  from autograd import value_and_grad
  from functools import partial
  from os.path import join, dirname
  import string
label_desc: Use image node_id 2 for calling a global function with example usage: normalize(a) and returns: unknown, np