<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def eigenvalues_rev(T, k=None, mu=None):
 r"""Compute eigenvalues of reversible transition matrix. Parameters T : (d, d) ndarray Transition matrix (stochastic matrix) k : int or tuple of ints, optional Compute the first k eigenvalues of T mu : (d,) ndarray, optional Stationary distribution of T Returns ------- eig : (n,) ndarray, The eigenvalues of T ordered with decreasing absolute value. If k is None then n=d, if k is int then n=k otherwise n is the length of the given tuple of eigenvalue indices. Raises ------ ValueError If stationary distribution is nonpositive. """


    """compute stationary distribution if not given"""
    if mu is None:
        mu = stationary_distribution(T)
    if np.any(mu <= 0):
        raise ValueError('Cannot symmetrize transition matrix')
    """ symmetrize T """
    smu = np.sqrt(mu)
    S = smu[:,None] * T / smu
    """ symmetric eigenvalue problem """
    evals = eigvalsh(S)
    return evals