Json Key Value Array Sort Function In Python