Python Create Json Array Javascript Function Definition