def cpu_count(logical=True):
    """Return system CPU count
    """
    if logical:
        from multiprocessing import cpu_count
        ncpu=cpu_count()
    else:
        import psutil
        ncpu=psutil.cpu_count(logical=False)
    return ncpu
Return system CPU count