Fixed index api in python binding