Python Function Inside Function Javascript Code Editor