Python Access Nested Function In Typescript