This is updated version after recent python-team merge.