code: def normalize(pdf):
      """Normalize distribution `pdf` in-place so it sums to 1.0.
  
      Returns pdf for convienence, so you can write things like:
  
      >>> kernel = normalize(randn(7))
  
      Parameters
      ----------
  
      pdf : ndarray
          discrete distribution that needs to be converted to a pdf. Converted
          in-place, i.e., this is modified.
  
      Returns
      -------
  
      pdf : ndarray
          The converted pdf.
      """
  
      pdf /= sum(np.asarray(pdf, dtype=float))
      return pdf
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import numpy
  from scipy.ndimage.filters import convolve
  from scipy.ndimage.interpolation import shift
label_desc: Use image node_id 1 for calling a global function with example usage: normalize(pdf) and returns: pdf