'Returns the homogeneous order of ``f``.'

def homogeneous_order(f):

    if f.is_zero:
        return (- oo)
    monoms = f.monoms()
    tdeg = sum(monoms[0])
    for monom in monoms:
        _tdeg = sum(monom)
        if (_tdeg != tdeg):
            return None
    return tdeg
