<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def eigvalsh(a, eigvec=False):
 """ Eigenvalues of Hermitian matrix ``a``. Args: a: Two-dimensional, square Hermitian matrix/array of numbers and/or :class:`gvar.GVar`\s. Array elements must be real-valued if `gvar.GVar`\s are involved (i.e., symmetric matrix). eigvec (bool):
 If ``True``, method returns a tuple of arrays ``(val, vec)`` where ``val[i]`` are the eigenvalues of ``a``, and ``vec[:, i]`` are the mean values of the corresponding eigenvectors. Only ``val`` is returned if ``eigvec=False`` (default). Returns: Array ``val`` of eigenvalues of matrix ``a`` if parameter ``eigvec==False`` (default); otherwise a tuple of arrays ``(val, vec)`` where ``val[i]`` are the eigenvalues (in ascending order) and ``vec[:, i]`` are the mean values of the corresponding eigenvectors. Raises: ValueError: If matrix is not square and two-dimensional. """

    if eigvec == True:
        val, vec = eigh(a, eigvec=True)
        return val, gvar.mean(vec)
    else:
        return eigh(a, eigvec=False)