put this in an if-block:

```
if factor is None:
    factor = ...
```