Changed `a.has_key(b)` to `b in a` to suppoert Python3.

Signed-off-by: Taku Fukushima <f.tac.mac@gmail.com>