I've noticed you use two different styles for the same check in the code.

Once you compare it to `None` (`is not None`) and the other time you just check if it's truthy (`if foo`). It would be good if you could use a consistent style.

I usually prefer to be explicit and use `is not None` check, but a valid value in this case is always truthy (0, empty list, None, etc. are not valid values for this argument) so you can get away with just checking if the argument is truthy.