Did I find the right examples for you? yes no

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
Return the number of logical CPUs in the system (same as
os.cpu_count() in Python 3.4).

If logical is False return the number of physical cores only
(hyper thread CPUs are excluded).

Return None if undetermined.

The return value is cached after first call.
If desired cache can be cleared like this:(more...)

            @wraps(fun)
    def wrapper(*args, **kwargs):
        key = (args, frozenset(sorted(kwargs.items())))
        lock.acquire()
        try:
            try:
                return cache[key]
            except KeyError:
                ret = cache[key] = fun(*args, **kwargs)
        finally:
            lock.release()
        return ret
        


src/h/t/HTPC-Manager-HEAD/modules/stats.py   HTPC-Manager(Download)
    def num_cpu(self):
        try:
            if psutil.version_info >= (2,0,0):
                cpu = psutil.cpu_count(logical=False)
            else:

src/s/a/salt-HEAD/salt/modules/ps.py   salt(Download)
    '''
    try:
        return psutil.cpu_count()
    except AttributeError:
        # NUM_CPUS is deprecated but with older psutil versions this is needed

src/s/a/salt-thin-HEAD/salt/modules/ps.py   salt-thin(Download)
    '''
    try:
        return psutil.cpu_count()
    except AttributeError:
        # NUM_CPUS is deprecated but with older psutil versions this is needed

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
        # Get the number of core (CPU) (Used to display load alerts)
        try:
            self.core_number = psutil.cpu_count()
        except AttributeError:
            self.core_number = psutil.NUM_CPUS

src/g/l/glances-HEAD/glances/glances.py   glances(Download)
        # Get the number of core (CPU) (Used to display load alerts)
        try:
            self.core_number = psutil.cpu_count()
        except AttributeError:
            self.core_number = psutil.NUM_CPUS

src/c/m/cms-HEAD/cms/service/ResourceService.py   cms(Download)
                           for x in cpu_times)
        data["cpu"]["num_cpu"] = \
            psutil.cpu_count() if PSUTIL2 else psutil.NUM_CPUS
        self._prev_cpu_times = cpu_times
 

src/p/s/psutil-2.1.1/test/test_psutil.py   psutil(Download)
    def test_cpu_count(self):
        logical = psutil.cpu_count()
        self.assertEqual(logical, len(psutil.cpu_times(percpu=True)))
        self.assertGreaterEqual(logical, 1)
        #
        physical = psutil.cpu_count(logical=False)