### Dimension of weight spaces of Lie algebra representation

Consider a Lie algebra $\frak{g}$. Let $\lambda$ be a dominant integral weight and $L(\lambda)$ be the unique irreducible representation of highest weight $\lambda$. (Since $\lambda$ is dominant and integral, $L(\lambda)$ is finite dimensional).

We know that $L(\lambda)$ decomposes into a direct sum
$$L(\lambda)=\bigoplus_{\mu} L(\lambda)_\mu$$
where $L(\lambda)_\mu$ is a weight space of weight $\mu$.

Is there a way to compute $\dim L(\lambda)_\mu$ in Sage?

I know that Freudenthal formula can be used to find these dimensions by hand. But I want to verify if my calculations are correct. Thanks in advance!