Returns the number of cpus with utilization less than `thresh` percent

def num_unused_cpus(thresh=10):
    """
    Returns the number of cpus with utilization less than `thresh` percent
    """
    import psutil
    cpu_usage = psutil.cpu_percent(percpu=True)
    return sum([p < thresh for p in cpu_usage])