Solution (source code)

= Solution

The denominator vanishes when $z=(2j+1)i\pi/2$. For $R>0$, only $z_0=i\pi/2$ lies inside the rectangle. This is a <simple pole>, since the denominator <derivative> there is $2$. Its <residue> is
$$
\operatorname{Res}_{z_0}\frac{e^{iz^2/\pi}}{1+e^{-2z}}=\frac12e^{-i\pi/4}.
$$
The positive orientation and the <residue theorem> consequently give
$$
\boxed{I=2\pi i\left(\tfrac12e^{-i\pi/4}\right)=\frac{\pi(1+i)}{\sqrt2}.}
$$