This eliminates unnecessarily importing multiprocessing. multiprocessing.cpu_count() just calls os.cpu_count() anyway:
https://github.com/python/cpython/blob/main/Lib/multiprocessing/context.py#L43
The or 1 keeps the linter happy since os.cpu_count() can return None in some rare cases.