I know if I integrate a circular arc of an angle $\theta < 2\pi$ about an isolated singularity of the complex funciton I would get a fraction $\frac{\theta}{2\pi}$ of the residue of that singularity. For example, integrrating $\frac{1}{z}$ about an arc of radius 1 about $z=0$ would give $i\pi$.
But I am not sure how this applies to situation where we integrate along an open curve (that is not an arc) near some isolated singularity. Say, we want to integrate $\frac{1}{z}$ along $x=1, -i<y<i$. That gave me $\frac{i\pi}{2}$ which I can see since I could deform this segment to an arc of angle $\frac{\pi}{2}$. This I am still ok with.
What about integrating $\frac{1}{z}$ along $x=1, 0<y<2i$? I cannot tell to which arc this would deform.
The case when we have more than 1 isolated singularities, say, $\frac{1}{(z)(z-(1+i))}$ along $x=2, 0<y<3i$?
These are just some random examples so I would prefer if answers are as general as possible.
The function $f(z)=1/z$, restricted to a simply connected domain which does not contain $0$, has a primitive function, $F(z)=\log(z)$. Thus, if $\gamma$ is a curve that goes from $1$ to $1+2i$ without going around $0$, we have$$\int_\gamma \frac{dz}{z}=\log(1+2i)-log(1).$$
The function $$f(z)=\frac{1}{(z-z_1)\ldots(z-z_n)}$$can be expressed as a sum$$f(z)=\frac{a_1}{z-z_1}+\ldots+\frac{a_n}{z-z_n}.$$Then its integral along a curve is equal to the sum of integrals which can be calculated as above.