code: def nucnorm(x0, rho, gamma):
      
  
      # compute SVD
      u, s, v = np.linalg.svd(x0, full_matrices=False)
  
      # soft threshold the singular values
      sthr = np.maximum(s - (gamma / float(rho)), 0)
  
      # reconstruct
      x_out = (u.dot(np.diag(sthr)).dot(v))
  
      return x_out
docs: Proximal operator for the nuclear norm (sum of the singular values of a matrix)
  
      Parameters
      ----------
      x0 : array_like
          The starting or initial point used in the proximal update step
  
      rho : float
          Momentum parameter for the proximal step (larger value -> stays closer to x0)
  
      gamma : float
          A constant that weights how strongly to enforce the constraint
  
      Returns
      -------
      theta : array_like
          The parameter vector found after running the proximal update step