'as_leading_term is only allowed for results of .series()
This is a wrapper to compute a series first.'

def compute_leading_term(self, x, logx=None):

    from sympy import Dummy, log
    from sympy.series.gruntz import calculate_series
    if (self.removeO() == 0):
        return self
    if (logx is None):
        d = Dummy('logx')
        s = calculate_series(self, x, d).subs(d, log(x))
    else:
        s = calculate_series(self, x, logx)
    return s.as_leading_term(x)
