def METHOD_NAME(n, m, bc='dirichlet'):
    '''Get the energy of a disk harmonic function.
    This allows for functions to sort a disk harmonic mode basis on energy.
    Parameters
    ----------
    n : int
        Radial order
    m : int
        Azimuthal order
    bc : string
        The boundary conditions to use. This can be either 'dirichlet', or
        'neumann' for a Dirichlet or Neumann boundary condition respectively.
    Returns
    -------
    scalar
        The energy corresponding to the mode.
    Raises
    ------
    ValueError
        If the boundary condition is not recognized.
    '''
    m = abs(m)
    if bc == 'dirichlet':
        lambda_mn = jn_zeros(m, n)[-1]
    elif bc == 'neumann':
        lambda_mn = jnp_zeros(m, n)[-1]
    else:
        raise ValueError('Boundary condition not recognized.')
    return lambda_mn**2