(self, *symbols)
Returns the leading (nonzero) term of the series expansion of self.

        The _eval_as_leading_term routines are used to do this, and they must
        always return a non-zero value.

        Examples
        ========

        >>> from sympy.abc import x
        >>> (1 + x + x**2).as_leading_term(x)
        1
        >>> (1/x**2 + x + x**2).as_leading_term(x)
        x**(-2)
Returns the leading (nonzero) term of the series expansion of self.
Returns the leading ( nonzero ) term of the series expansion of self .
def as_leading_term(self, *symbols):
        """
        Returns the leading (nonzero) term of the series expansion of self.

        The _eval_as_leading_term routines are used to do this, and they must
        always return a non-zero value.

        Examples
        ========

        >>> from sympy.abc import x
        >>> (1 + x + x**2).as_leading_term(x)
        1
        >>> (1/x**2 + x + x**2).as_leading_term(x)
        x**(-2)

        """
        from sympy import powsimp
        if len(symbols) > 1:
            c = self
            for x in symbols:
                c = c.as_leading_term(x)
            return c
        elif not symbols:
            return self
        x = sympify(symbols[0])
        if not x.is_Symbol:
            raise ValueError('expecting a Symbol but got %s' % x)
        if x not in self.free_symbols:
            return self
        obj = self._eval_as_leading_term(x)
        if obj is not None:
            return powsimp(obj, deep=True, combine='exp')
        raise NotImplementedError('as_leading_term(%s, %s)' % (self, x))
def as_leading_term ( self , * symbols ) : from sympy import powsimp if len ( symbols ) > 1 : c = self for x in symbols : c = c . as_leading_term ( x ) return c elif not symbols : return self x = sympify ( symbols [ 0 ] ) if not x . is_Symbol : raise ValueError ( 'expecting a Symbol but got %s' % x ) if x not in self . free_symbols : return self obj = self . _eval_as_leading_term ( x ) if obj is not None : return powsimp ( obj , deep = True , combine = 'exp' ) raise NotImplementedError ( 'as_leading_term(%s, %s)' % ( self , x ) )