code: def projection_simplex(v, z=1):
      """
      Old implementation for test and benchmark purposes.
      The arguments v and z should be a vector and a scalar, respectively.
      """
      n_features = v.shape[0]
      u = np.sort(v)[::-1]
      cssv = np.cumsum(u) - z
      ind = np.arange(n_features) + 1
      cond = u - cssv / ind > 0
      rho = ind[cond][-1]
      theta = cssv[cond][-1] / float(rho)
      w = np.maximum(v - theta, 0)
      return w
  
label_desc: Use image node_id 1 for calling a global function with example usage: projection_simplex(v, z) and returns: w