1. is there a way to compute the residue of a meromorphic function $f(z)$ at $z=z_0$ in sage?
2. if so, I'd like to nest such method to compute residue at a flag, $$\operatorname{Res}_F f(x_1,\ldots,x_n) := \operatorname{Res}_{x_1=x_1^,\ldots,x_n=x_n^}\cdots\operatorname{Res}_{x_2=x_2^, x_1=x_1^} \operatorname{Res}_{x_1=x_1^} f(x_1,\ldots,x_n)$$ where starred values denote a numerical value (same as $z_0$ before) and the flag is $$F =([x_1=x_1^,\ldots,x_n=x_n^] \supset \cdots \supset [x_2=x_2^, x_1=x_1^] \supset [x_1=x_1^])$$ Notice the choice of order matters. For example, let $f = \frac1{(1-x_1)(1-x_1 x_2)}$ and $F = ( [x_1=1] \subset [x_2=1, x_1=1])$. Then $$\operatorname{Res}_F f(x_1,x_2) = 1$$
3. if that works, I'd like to build a function that takes as input the point $(x_1,\ldots,x_n)^*$, for various values of $n$, builds $f$ in a certain way, and gives back the residue as a function of the input: is this achievable?