Typescript If Not Empty Python Dictionary Append For Loop