(f, *gens, **args)
return monom.as_expr()
Return the leading monomial of ``f``.

    Examples
    ========

    >>> from sympy import LM
    >>> from sympy.abc import x, y

    >>> LM(4*x**2 + 2*x*y**2 + x*y + 3*y)
    x**2
Return the leading monomial of ``f``.
Return the leading monomial of f .
def LM(f, *gens, **args):
    """
    Return the leading monomial of ``f``.

    Examples
    ========

    >>> from sympy import LM
    >>> from sympy.abc import x, y

    >>> LM(4*x**2 + 2*x*y**2 + x*y + 3*y)
    x**2

    """
    options.allowed_flags(args, ['polys'])

    try:
        F, opt = poly_from_expr(f, *gens, **args)
    except PolificationFailed as exc:
        raise ComputationFailed('LM', 1, exc)

    monom = F.LM(order=opt.order)
    return monom.as_expr()
def LM ( f , * gens , * * args ) : options . allowed_flags ( args , [ 'polys' ] ) try : F , opt = poly_from_expr ( f , * gens , * * args ) except PolificationFailed as exc : raise ComputationFailed ( 'LM' , 1 , exc ) monom = F . LM ( order = opt . order ) return monom . as_expr ( )