Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/p/y/pyriemann-HEAD/examples/riemann_health.py   pyriemann(Download)
def cores():
    return psutil.NUM_CPUS
 
def cpu_report():
    r, w, e = popen2.popen3('ps -eo pcpu,pid,args | sort -nrb -k1 | head -10')

src/a/u/AutobahnPython-HEAD/examples/twisted/websocket/echo_multicore/server.py   AutobahnPython(Download)
   import psutil
 
   DEFAULT_WORKERS = psutil.NUM_CPUS
 
   parser = argparse.ArgumentParser(description = 'Autobahn WebSocket Echo Multicore Server')

src/p/s/psdash-0.3.0/psdash/web.py   psdash(Download)
        "uptime": str(uptime).split(".")[0],
        "load_avg": load_avg,
        "cpus": psutil.NUM_CPUS,
        "vmem": psutil.virtual_memory(),
        "swap": psutil.swap_memory(),

src/p/s/psdash-HEAD/psdash/web.py   psdash(Download)
        "uptime": str(uptime).split(".")[0],
        "load_avg": load_avg,
        "cpus": psutil.NUM_CPUS,
        "vmem": psutil.virtual_memory(),
        "swap": psutil.swap_memory(),

src/n/e/newRHELic-HEAD/newrelic.py   newRHELic(Download)
            #self.metric_data['Component/System Information/Boot Time[datetime]'] = self._get_boottime()
            self.metric_data['Component/System Information/Process Count[process]'] = len(psutil.get_pid_list())
            self.metric_data['Component/System Information/Core Count[core]'] = psutil.NUM_CPUS
            self.metric_data['Component/System Information/Active Sessions[session]'] = len(psutil.get_users())
        except Exception, e:

src/h/t/HTPC-Manager-HEAD/modules/stats.py   HTPC-Manager(Download)
                cpu = psutil.cpu_count(logical=False)
            else:
                cpu = psutil.NUM_CPUS
            dcpu = cpu._asdict()
            jcpu  = json.dumps(dcpu)

src/s/l/slapos.core-HEAD/slapos/collect/snapshot.py   slapos.core(Download)
  def __init__(self):
    self.cpu_num_core = psutil.NUM_CPUS
    self.cpu_frequency = 0
    self.cpu_type = 0
    self.memory_size = psutil.TOTAL_PHYMEM  

src/s/a/salt-HEAD/salt/modules/ps.py   salt(Download)
        # NUM_CPUS is deprecated but with older psutil versions this is needed
        # as a fallback.
        return psutil.NUM_CPUS
 
 

src/s/a/salt-thin-HEAD/salt/modules/ps.py   salt-thin(Download)
        # NUM_CPUS is deprecated but with older psutil versions this is needed
        # as a fallback.
        return psutil.NUM_CPUS
 
 

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
            self.core_number = psutil.cpu_count()
        except AttributeError:
            self.core_number = psutil.NUM_CPUS
 
        # get psutil version

  1 | 2 | 3 | 4  Next