python sort list based on dictionary value