code: def project_simplex_bisection(v, z=1, tau=0.0001, max_iter=1000):
      lower = 0
      upper = np.max(v)
      current = np.inf
  
      for it in range(max_iter):
          if np.abs(current) / z < tau and current < 0:
              break
  
          theta = (upper + lower) / 2.0
          w = np.maximum(v - theta, 0)
          current = np.sum(w) - z
          if current <= 0:
              upper = theta
          else:
              lower = theta
      return w
  
imports: import numpy
  import pytest
  from lightning.impl.penalty import project_l1_ball, project_simplex
label_desc: Use image node_id 1 for calling a global function with example usage: project_simplex_bisection(v, z, tau, max_iter) and returns: w