This is a small thing, but you might instead use `None` instead of ``'all'``, as ``samples is None`` is slightly faster than string equality testing