code: def normalize(l):
      """
      Normalizes input list.
  
      Parameters
      ----------
      l: list
          The list to be normalized
  
      Returns
      -------
      The normalized list or numpy array
  
      Raises
      ------
      ValueError, if the list sums to zero
      """
  
      s = float(sum(l))
      if s == 0:
          raise ValueError("Cannot normalize list with sum 0")
      return [x / s for x in l]
  
file_path: python-ternary/ternary/helpers.py
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: normalize(l) and returns: unknown