In python, it is more common to see:
```
if profile is not None:
```