multiplicity(v,M)
The example below shows that the $sl_3$ module with highest weight $(2,1)$ contains the weight $(-1,1)$ with multiplicity 2.
i1 : g=simpleLieAlgebra("A",2) o1 = g o1 : simple LieAlgebra
i2 : V=irreducibleLieAlgebraModule({2,1},g) o2 = V o2 : irreducible LieAlgebraModule over g
i3 : multiplicity({-1,1},V) o3 = 2