Hi Chunyang, This bug was introduced by commit 1966d58b2, which “fixed” another problematic case of indentation. Because of issues like this, ob-python has never really worked reliably (in my experience)
The only sensible way I can see to evaluate python code from emacs without hitting these kinds of errors is to use jupyter (formerly ipython). You might try the ob-ipython or ob-ein libraries and see if they work for you. (The latter is part of ein, which provides lots of integration emacs <-> jupyter, and not only for org-babel). Disclaimer: I havenʼt used either of these libraries personally, so I donʼt know how well they will work for you. -- Aaron Ecay