Java Bitwise Shift Python Code