Javascript Hashmap From Array Python