Js Reduce Return Array Of Structures In Python