def num_cpus():
    cpus = 0
    try:
        cpus = os.sysconf('SC_NPROCESSORS_ONLN')
    except:
        cpus = multiprocessing.cpu_count()
    return (cpus or 3)
def num_cpus():
    cpus = 0
    try:
        cpus = os.sysconf('SC_NPROCESSORS_ONLN')
    except:
        cpus = multiprocessing.cpu_count()
    return (cpus or 3)