K iTdZddlmZddlmZddlmZddlmZeddZ y) zZ This module implements the Residue function and related tools for working with residues. )Mul)S)sympify)timethisresiduecXddlm}ddlm}t |}|dk7r|j |||z}dD];}|j ||}|j|r|jdk\s;n|j|}|jr |j}n|g}tj}|D]p} | j|\} } t| } | tj |fvs0| j"r| j$j&st)d| z| d|z k(sl|| z }r|S)a Finds the residue of ``expr`` at the point x=x0. The residue is defined as the coefficient of ``1/(x-x0)`` in the power series expansion about ``x=x0``. Examples ======== >>> from sympy import Symbol, residue, sin >>> x = Symbol("x") >>> residue(1/x, x, 0) 1 >>> residue(1/x**2, x, 0) 0 >>> residue(2/sin(x), x, 0) 2 This function is essential for the Residue Theorem [1]. References ========== .. [1] https://en.wikipedia.org/wiki/Residue_theorem r)Order)collect)r )nzterm of unexpected form: %sr )sympy.series.orderr sympy.simplify.radsimpr rsubsnserieshasgetnremoveOis_AddargsrZero as_coeff_mulrOneis_Powexp is_IntegerNotImplementedError) exprxx0r r rsrresargcms [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/series/residues.pyrr sN). 4=D QwyyAF# $ LLaL uuU|qvvx1}   QAxxvvs &&C"1 GaeeQZAHH1A1A%&Ca&GH H !8 1HC  JN) __doc__sympy.core.mulrsympy.core.singletonrsympy.core.sympifyrsympy.utilities.timeutilsrrr+r*r2s1 "&. )<<r+