# Non-isolated singularity and contour integral

I encounter contour integrals of the following form, $$\oint_{|z| = 1} f_q(z) \frac{ dz }{ 2\pi i}\ , \qquad |q| < 1$$

where

1. the meromorphic function $$f_q(z)$$ contains a lot of simple poles of the form $$z_{in} = a_{i} q^{n}, n = 0, 1, 2, ...$$ (with $$|a_i| < 1$$) inside the unit circle: so there is a non-isolated singularity at the origin.
2. Inside each annulus $$|q|^{n} > |z| > |q|^{n + 1}$$, all residues from the poles within cancel each other. Naively, the integral receives contribution only from the non-isolated singularity at the origin.

One such example is $$\oint \frac{dz}{2\pi i z} \left(\frac{1}{z} - z\right)^2 \frac{(z^2 q;q)^2(z^{-2}q;q)^2}{\prod_{\pm}(z^2 b^\pm q^{1/2};q)(z^{-2} b^\pm q^{1/2};q)}$$ where $$(z;q)$$ denotes the usual $$q$$-Pochhammer symbol.

In physics application, we usually simply expand the integrand in $$q$$-series $$f_q(z) = \sum_{k} f^{(k)}(z)q^k$$ and then observe that all coefficients of expansion $$f^{(k)}(z)$$ only have poles at the origin $$z = 0$$, and one simply extracts the residue there and gets a $$q$$-series as the final answer.

I wonder if one can properly treat the integral without first performing the $$q$$-expansion? Are we allowed to talk about "residue" at a non-isolated singularity?