def get_all_monomials(variables, extramonomials, substitutions, degree,<EOL>removesubstitutions=True):
monomials = get_monomials(variables, degree)<EOL>if extramonomials is not None:<EOL><INDENT>monomials.extend(extramonomials)<EOL><DEDENT>if removesubstitutions and substitutions is not None:<EOL><INDENT>monomials = [monomial for monomial in monomials if monomial not<EOL>in substitutions]<EOL>monomials = [remove_scalar_factor(apply_substitutions(monomial,<EOL>substitutions))<EOL>for monomial in monomials]<EOL><DEDENT>monomials = unique(monomials)<EOL>return monomials<EOL>
Return the monomials of a certain degree.