from typing import Optional


def check_n_jobs(n_jobs: Optional[int] = None):
    """Parse the ``n_jobs`` parameter for multiprocessing."""
    if n_jobs == -1:
        return None
    elif n_jobs is None:
        return 1
    else:
        return n_jobs