code: def normalize(a, axis=None):
      """
      Normalize the input array so that it sums to 1.
  
      Parameters
      ----------
      a : array
          Non-normalized input data.
  
      axis : int
          Dimension along which normalization is performed.
  
      Notes
      -----
      Modifies the input **inplace**.
      """
      a_sum = a.sum(axis)
      if axis and a.ndim > 1:
          # Make sure we don't divide by zero.
          a_sum[a_sum == 0] = 1
          shape = list(a.shape)
          shape[axis] = 1
          a_sum.shape = shape
  
      a /= a_sum
  
imports: import numpy
  from scipy import special
label_desc: Use image node_id 1 for calling a global function with example usage: normalize(a, axis) without return types