Python Sort With Indices Definition