import psutil


def num_unused_cpus(thresh=10):
    """
    Returns the number of cpus with utilization less than `thresh` percent
    """

    cpu_usage = psutil.cpu_percent(percpu=True)
    return sum([p < thresh for p in cpu_usage])