def softT(m, threshold, zeta):
    """
    Soft-Threshold for solving univariate lasso.
    """
    # m: float; m_j in the thesis
    # t: float; truncation threshold
    # zeta: float; penalty factor, the same as the `lambda` in the thesis.
    if (zeta < abs(m)):
        z = (-m - zeta) / (2 * threshold) if (m < 0) else (-m + zeta) / (2 * threshold)
    else:
        z = 0
    return z