Typescript If Not Null Python Code