convert namespace object to dict python