Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
psutil | psutil-master/psutil/arch/solaris/environ.c | /*
* Copyright (c) 2009, Giampaolo Rodola', Oleksii Shevchuk.
* All rights reserved. Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*
* Functions specific for Process.environ().
*/
#define _STRUCTURED_PROC 1
#include <Python.h>
#if !defined(_LP64) && _FILE_O... | 10,181 | 24.140741 | 78 | c |
psutil | psutil-master/psutil/arch/solaris/environ.h | /*
* Copyright (c) 2009, Giampaolo Rodola', Oleksii Shevchuk.
* All rights reserved. Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
#ifndef PROCESS_AS_UTILS_H
#define PROCESS_AS_UTILS_H
char **
psutil_read_raw_args(psinfo_t info, const char *procfs_path, siz... | 511 | 24.6 | 76 | h |
psutil | psutil-master/psutil/arch/solaris/v10/ifaddrs.c | /* References:
* https://lists.samba.org/archive/samba-technical/2009-February/063079.html
* http://stackoverflow.com/questions/4139405/#4139811
* https://github.com/steve-o/openpgm/blob/master/openpgm/pgm/getifaddrs.c
*/
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <net/if.h>
#include <net... | 3,254 | 24.833333 | 82 | c |
psutil | psutil-master/psutil/arch/solaris/v10/ifaddrs.h | /* Reference: https://lists.samba.org/archive/samba-technical/2009-February/063079.html */
#ifndef __IFADDRS_H__
#define __IFADDRS_H__
#include <sys/socket.h>
#include <net/if.h>
#undef ifa_dstaddr
#undef ifa_broadaddr
#define ifa_broadaddr ifa_dstaddr
struct ifaddrs {
struct ifaddrs *ifa_next;
char ... | 567 | 20.037037 | 90 | h |
psutil | psutil-master/psutil/arch/windows/cpu.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
#include <PowrProf.h>
#include "../../_psutil_common.h"
/*
* Return the number of logical, active CP... | 11,539 | 26.807229 | 79 | c |
psutil | psutil-master/psutil/arch/windows/cpu.h | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_cpu_count_logical(PyObject *self, PyObject *args);
PyObject *psutil_cpu_count_cores(PyObject *self, PyObjec... | 573 | 37.266667 | 73 | h |
psutil | psutil-master/psutil/arch/windows/disk.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
#include <tchar.h>
#include "../../_psutil_common.h"
#ifndef _ARRAYSIZE
#define _ARRAYSIZE(a) (sizeof... | 12,338 | 30.719794 | 77 | c |
psutil | psutil-master/psutil/arch/windows/disk.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_disk_io_counters(PyObject *self, PyObject *args);
PyObject *psutil_disk_partitions(PyObject *sel... | 466 | 34.923077 | 73 | h |
psutil | psutil-master/psutil/arch/windows/mem.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
#include <Psapi.h>
#include <pdh.h>
#include "../../_psutil_common.h"
PyObject *
psutil_ge... | 2,808 | 28.568421 | 81 | c |
psutil | psutil-master/psutil/arch/windows/mem.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_getpagesize(PyObject *self, PyObject *args);
PyObject *psutil_virtual_mem(PyObject *self, PyObje... | 394 | 31.916667 | 73 | h |
psutil | psutil-master/psutil/arch/windows/net.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// Fixes clash between winsock2.h and windows.h
#define WIN32_LEAN_AND_MEAN
#include <Python.h>
#include <windows.h>
#include <wchar.h>
#include... | 13,404 | 29.605023 | 79 | c |
psutil | psutil-master/psutil/arch/windows/net.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_net_if_addrs(PyObject *self, PyObject *args);
PyObject *psutil_net_if_stats(PyObject *self, PyOb... | 399 | 32.333333 | 73 | h |
psutil | psutil-master/psutil/arch/windows/ntextapi.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
* Define Windows structs and constants which are considered private.
*/
#if !defined(__NTEXTAPI_H__)
#define __NTEXTAPI_H__
#include <wi... | 19,323 | 26.293785 | 120 | h |
psutil | psutil-master/psutil/arch/windows/proc.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* Process related functions. Original code was moved in here from
* psutil/_psutil_windows.c in 2023. For reference, here's the GIT blame
*... | 34,915 | 27.022472 | 78 | c |
psutil | psutil-master/psutil/arch/windows/proc.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *TimeoutExpired;
PyObject *TimeoutAbandoned;
PyObject *psutil_pid_exists(PyObject *self, PyObject *args... | 1,767 | 49.514286 | 73 | h |
psutil | psutil-master/psutil/arch/windows/proc_handles.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* This module retrieves handles opened by a process.
* We use NtQuerySystemInformation to enumerate them and NtQueryObject
* to obtain the ... | 8,177 | 26.911263 | 79 | c |
psutil | psutil-master/psutil/arch/windows/proc_handles.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
PyObject* psutil_get_open_files(DWORD pid, HANDLE hProcess);
| 289 | 25.363636 | 73 | h |
psutil | psutil-master/psutil/arch/windows/proc_info.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Helper functions related to fetching process information. Used by
* _psutil_windows module methods.
*/
#include <Python.h>
#includ... | 26,170 | 29.609357 | 81 | c |
psutil | psutil-master/psutil/arch/windows/proc_info.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
#include "ntextapi.h"
#define PSUTIL_FIRST_PROCESS(Processes) ( \
(PSYSTEM_PROCESS_INFO... | 961 | 37.48 | 80 | h |
psutil | psutil-master/psutil/arch/windows/proc_utils.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Helper process functions.
*/
#include <Python.h>
#include <windows.h>
#include <Psapi.h> // EnumProcesses
#include "../../_psutil... | 5,530 | 28.110526 | 78 | c |
psutil | psutil-master/psutil/arch/windows/proc_utils.h | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
DWORD* psutil_get_pids(DWORD *numberOfReturnedPIDs);
HANDLE psutil_handle_from_pid(DWORD pid, DWORD dwDesiredAccess);
HANDLE psutil_check_phandle... | 517 | 38.846154 | 77 | h |
psutil | psutil-master/psutil/arch/windows/security.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Security related functions for Windows platform (Set privileges such as
* SE DEBUG).
*/
#include <windows.h>
#include <Python.h>
... | 3,656 | 25.309353 | 79 | c |
psutil | psutil-master/psutil/arch/windows/security.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Security related functions for Windows platform (Set privileges such as
* SeDebug), as well as security helper functions.
*/
#incl... | 365 | 25.142857 | 74 | h |
psutil | psutil-master/psutil/arch/windows/sensors.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
// Added in https://github.com/giampaolo/psutil/commit/109f873 in 2017.
// Moved in here in... | 895 | 26.151515 | 79 | c |
psutil | psutil-master/psutil/arch/windows/sensors.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_sensors_battery(PyObject *self, PyObject *args);
| 273 | 26.4 | 73 | h |
psutil | psutil-master/psutil/arch/windows/services.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <windows.h>
#include <Winsvc.h>
#include "../../_psutil_common.h"
#include "services.h"
// ======================... | 12,998 | 26.024948 | 78 | c |
psutil | psutil-master/psutil/arch/windows/services.h | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <Winsvc.h>
SC_HANDLE psutil_get_service_handle(
char service_name, DWORD scm_access, DWORD access);
PyObject *p... | 734 | 39.833333 | 73 | h |
psutil | psutil-master/psutil/arch/windows/socks.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// Fixes clash between winsock2.h and windows.h
#define WIN32_LEAN_AND_MEAN
#include <Python.h>
#include <windows.h>
#include <ws2tcpip.h>
#inc... | 14,505 | 29.733051 | 79 | c |
psutil | psutil-master/psutil/arch/windows/socks.h | /*
* Copyright (c) 2009, Giampaolo Rodola', Jeff Tang. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_net_connections(PyObject *self, PyObject *args);
| 273 | 26.4 | 73 | h |
psutil | psutil-master/psutil/arch/windows/sys.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
System related functions. Original code moved in here from
psutil/_psutil_windows.c in 2023. For reference, here's the GIT blame
hi... | 5,685 | 30.765363 | 136 | c |
psutil | psutil-master/psutil/arch/windows/sys.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_boot_time(PyObject *self, PyObject *args);
PyObject *psutil_users(PyObject *self, PyObject *args... | 323 | 28.454545 | 73 | h |
psutil | psutil-master/psutil/arch/windows/wmi.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Functions related to the Windows Management Instrumentation API.
*/
#include <Python.h>
#include <windows.h>
#include <pdh.h>
#include "../..... | 3,695 | 29.545455 | 120 | c |
psutil | psutil-master/psutil/arch/windows/wmi.h | /*
* Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject* psutil_init_loadavg_counter();
PyObject* psutil_get_loadavg();
| 268 | 23.454545 | 73 | h |
psutil | psutil-master/psutil/tests/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test utilities.
"""
from __future__ import print_function
import atexit
import contextlib
import ctypes
import errno
import ... | 59,235 | 31.422551 | 79 | py |
psutil | psutil-master/psutil/tests/__main__.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Run unit tests. This is invoked by:
$ python -m psutil.tests
"""
from .runner import main
main()
| 293 | 17.375 | 72 | py |
psutil | psutil-master/psutil/tests/runner.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Unit test runner, providing new features on top of unittest module:
- colourized output
- parallel run (UNIX only)
- print fail... | 11,204 | 30.923077 | 79 | py |
psutil | psutil-master/psutil/tests/test_aix.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'
# Copyright (c) 2017, Arnon Yaari
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""AIX specific tests."""
import re
import unittest
import psutil
from psutil import AIX
from ... | 4,508 | 35.658537 | 77 | py |
psutil | psutil-master/psutil/tests/test_bsd.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO: (FreeBSD) add test for comparing connections with 'sockstat' cmd.
"""Tests specific to all BSD platforms."""
import dat... | 21,057 | 35.182131 | 78 | py |
psutil | psutil-master/psutil/tests/test_connections.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for net_connections() and Process.connections() APIs."""
import os
import socket
import textwrap
import unittest
from con... | 20,910 | 37.368807 | 78 | py |
psutil | psutil-master/psutil/tests/test_contracts.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Contracts tests. These tests mainly check API sanity in terms of
returned types and APIs availability.
Some of these are duplica... | 27,749 | 35.85259 | 79 | py |
psutil | psutil-master/psutil/tests/test_linux.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux specific tests."""
from __future__ import division
import collections
import contextlib
import errno
import glob
import ... | 95,287 | 40.214533 | 79 | py |
psutil | psutil-master/psutil/tests/test_memleaks.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests for detecting function memory leaks (typically the ones
implemented in C). It does so by calling a function many times an... | 15,028 | 29.484787 | 79 | py |
psutil | psutil-master/psutil/tests/test_misc.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Miscellaneous tests.
"""
import ast
import collections
import errno
import json
import os
import pickl... | 34,885 | 35.301769 | 79 | py |
psutil | psutil-master/psutil/tests/test_osx.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""macOS specific tests."""
import platform
import re
import time
import unittest
import psutil
from psutil import MACOS
from psu... | 6,587 | 31.136585 | 79 | py |
psutil | psutil-master/psutil/tests/test_posix.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""POSIX specific tests."""
import datetime
import errno
import os
import re
import subprocess
import time... | 17,342 | 35.282427 | 79 | py |
psutil | psutil-master/psutil/tests/test_process.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for psutil.Process class."""
import collections
import errno
import getpass
import itertools
import os
import signal
impo... | 63,086 | 38.014842 | 79 | py |
psutil | psutil-master/psutil/tests/test_sunos.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sun OS specific tests."""
import os
import unittest
import psutil
from psutil import SUNOS
from psutil.tests import PsutilTest... | 1,310 | 27.5 | 76 | py |
psutil | psutil-master/psutil/tests/test_system.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for system APIS."""
import contextlib
import datetime
import errno
import os
import platform
import pprint
import shutil
... | 35,920 | 39.225084 | 79 | py |
psutil | psutil-master/psutil/tests/test_testutils.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests for testing utils (psutil.tests namespace).
"""
import collections
import contextlib
import errn... | 14,619 | 31.780269 | 79 | py |
psutil | psutil-master/psutil/tests/test_unicode.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Notes about unicode handling in psutil
======================================
Starting from version 5.... | 12,225 | 33.931429 | 74 | py |
psutil | psutil-master/psutil/tests/test_windows.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Windows specific tests."""
import datetime
import errno
import glob
import os
import platform
import re
... | 35,169 | 38.121246 | 79 | py |
psutil | psutil-master/scripts/battery.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Show battery information.
$ python3 scripts/battery.py
charge: 74%
left: 2:11:31
status: discharging
plugged in:... | 1,145 | 21.92 | 72 | py |
psutil | psutil-master/scripts/cpu_distribution.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Shows CPU workload split across different CPUs.
$ python3 scripts/cpu_workload.py
CPU 0 CPU 1 CPU 2 CPU 3 CPU ... | 3,952 | 35.266055 | 75 | py |
psutil | psutil-master/scripts/disk_usage.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
List all mounted disk partitions a-la "df -h" command.
$ python3 scripts/disk_usage.py
Device Total Used ... | 1,569 | 31.040816 | 78 | py |
psutil | psutil-master/scripts/fans.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Show fans information.
$ python fans.py
asus
cpu_fan 3200 RPM
"""
from __future__ import print_function
imp... | 772 | 19.342105 | 76 | py |
psutil | psutil-master/scripts/free.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'free' cmdline utility.
$ python3 scripts/free.py
total used free shared buffers ... | 1,148 | 25.72093 | 78 | py |
psutil | psutil-master/scripts/ifconfig.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'ifconfig' on UNIX.
$ python3 scripts/ifconfig.py
lo:
stats : speed=0MB, duplex=?, mtu=65536, up=yes
... | 3,329 | 31.647059 | 76 | py |
psutil | psutil-master/scripts/iotop.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of iotop (http://guichaz.free.fr/iotop/) showing real time
disk I/O statistics.
It works on Linux only (FreeBSD and ma... | 5,030 | 26.95 | 78 | py |
psutil | psutil-master/scripts/killall.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Kill a process by name.
"""
import os
import sys
import psutil
def main():
if len(sys.argv) != 2:
sys.exit('usa... | 695 | 18.333333 | 72 | py |
psutil | psutil-master/scripts/meminfo.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print system memory information.
$ python3 scripts/meminfo.py
MEMORY
------
Total : 9.7G
Available : 4.9G
Percent ... | 1,059 | 18.62963 | 72 | py |
psutil | psutil-master/scripts/netstat.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'netstat -antp' on Linux.
$ python3 scripts/netstat.py
Proto Local address Remote address Status PID ... | 1,946 | 28.5 | 78 | py |
psutil | psutil-master/scripts/nettop.py | #!/usr/bin/env python3
#
# $Id: iotop.py 1160 2011-10-14 18:50:36Z g.rodola@gmail.com $
#
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Shows real-time network statistics.
Author: Giampaolo Rodola... | 4,484 | 26.685185 | 73 | py |
psutil | psutil-master/scripts/pidof.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola', karthikrev. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'pidof' cmdline utility.
$ pidof python
1140 1138 1136 1134 1133 1129 1127 1125 1121 1120 1119
"""
fro... | 947 | 21.046512 | 75 | py |
psutil | psutil-master/scripts/pmap.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'pmap' utility on Linux, 'vmmap' on macOS and 'procstat -v' on BSD.
Report memory map of a process.
$ python3 scrip... | 2,182 | 31.102941 | 78 | py |
psutil | psutil-master/scripts/procinfo.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print detailed information about a process.
Author: Giampaolo Rodola' <g.rodola@gmail.com>
$ python3 scripts/procinfo.py
pid ... | 11,802 | 34.65861 | 79 | py |
psutil | psutil-master/scripts/procsmem.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Show detailed memory usage about all (querable) processes.
Processes are sorted by their "USS" (Unique Set Size) memory, which... | 3,757 | 34.45283 | 78 | py |
psutil | psutil-master/scripts/ps.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'ps aux'.
$ python3 scripts/ps.py
USER PID %MEM VSZ RSS NICE STATUS START TIME CMDLINE
root ... | 4,162 | 38.647619 | 79 | py |
psutil | psutil-master/scripts/pstree.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Similar to 'ps aux --forest' on Linux, prints the process list
as a tree structure.
$ python3 scripts/pstree.py
0 ?
|- 1 init
... | 1,693 | 22.205479 | 72 | py |
psutil | psutil-master/scripts/sensors.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'sensors' utility on Linux printing hardware temperatures,
fans speed and battery info.
$ p... | 2,709 | 27.829787 | 74 | py |
psutil | psutil-master/scripts/temperatures.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'sensors' utility on Linux printing hardware temperatures.
$ python3 scripts/sensors.py
asu... | 1,444 | 27.9 | 72 | py |
psutil | psutil-master/scripts/top.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of top / htop.
Author: Giampaolo Rodola' <g.rodola@gmail.com>
$ python3 scripts/top.py
CPU0 [|||| ... | 7,516 | 29.068 | 78 | py |
psutil | psutil-master/scripts/who.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'who' command; print information about users who are
currently logged in.
$ python3 scripts/who.py
giampaolo con... | 926 | 24.75 | 76 | py |
psutil | psutil-master/scripts/winservices.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""
List all Windows services installed.
$ python3 scripts/winservices.py
AeLookupSvc (Application Experience)
status: stopped, s... | 1,622 | 27.982143 | 79 | py |
psutil | psutil-master/scripts/internal/bench_oneshot.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple micro benchmark script which prints the speedup when using
Process.oneshot() ctx manager.
See: https://github.com/giam... | 3,317 | 20.133758 | 78 | py |
psutil | psutil-master/scripts/internal/bench_oneshot_2.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Same as bench_oneshot.py but uses perf module instead, which is
supposed to be more precise.
"""
import sys
import pyperf # ... | 1,063 | 18.703704 | 72 | py |
psutil | psutil-master/scripts/internal/check_broken_links.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola', Himanshu Shekhar.
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Checks for broken links in file names specified as command line
parameters.
There are a ton of a solutions a... | 8,018 | 29.60687 | 79 | py |
psutil | psutil-master/scripts/internal/clinter.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A super simple linter to check C syntax."""
from __future__ import print_function
import argparse
import sys
warned = False
... | 2,305 | 27.469136 | 77 | py |
psutil | psutil-master/scripts/internal/convert_readme.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Remove raw HTML from README.rst to make it compatible with PyPI on
dist upload.
"""
import argparse
import re
summary = """\... | 1,495 | 25.714286 | 88 | py |
psutil | psutil-master/scripts/internal/download_wheels_appveyor.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script which downloads wheel files hosted on AppVeyor:
https://ci.appveyor.com/project/giampaolo/psutil
Re-adapted from the orig... | 3,521 | 29.362069 | 76 | py |
psutil | psutil-master/scripts/internal/download_wheels_github.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script which downloads wheel files hosted on GitHub:
https://github.com/giampaolo/psutil/actions
It needs an access token string... | 2,933 | 27.211538 | 78 | py |
psutil | psutil-master/scripts/internal/generate_manifest.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Generate MANIFEST.in file.
"""
import os
import subprocess
SKIP_EXTS = ('.png', '.jpg', '.jpeg', '.svg')
SKIP_FILES = ('appve... | 857 | 20.45 | 72 | py |
psutil | psutil-master/scripts/internal/git_pre_commit.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This gets executed on 'git commit' and rejects the commit in case the
submitted code does not pass validation. Validation is run... | 4,971 | 31.496732 | 79 | py |
psutil | psutil-master/scripts/internal/print_access_denied.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Helper script iterates over all processes and .
It prints how many AccessDenied exceptions are raised in total and
for what Pro... | 3,307 | 33.821053 | 72 | py |
psutil | psutil-master/scripts/internal/print_announce.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Prints release announce based on HISTORY.rst file content.
See: https://pip.pypa.io/en/stable/reference/pip_install/#hash-checki... | 3,238 | 24.304688 | 76 | py |
psutil | psutil-master/scripts/internal/print_api_speed.py | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Benchmark all API calls and print them from fastest to slowest.
$ make print_api_speed
SYSTEM APIS NUM CALLS ... | 6,586 | 31.771144 | 78 | py |
psutil | psutil-master/scripts/internal/print_dist.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""List and pretty print tarball & wheel files in the dist/ directory."""
import argparse
import collections
import os
from psutil... | 3,539 | 26.874016 | 78 | py |
psutil | psutil-master/scripts/internal/print_downloads.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print PYPI statistics in MarkDown format.
Useful sites:
* https://pepy.tech/project/psutil
* https://pypistats.org/packages/psut... | 4,100 | 24.159509 | 77 | py |
psutil | psutil-master/scripts/internal/print_hashes.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Prints files hashes, see:
https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
"""
import argparse
import ha... | 1,105 | 25.333333 | 74 | py |
psutil | psutil-master/scripts/internal/print_timeline.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Prints releases' timeline in RST format.
"""
import subprocess
entry = """\
- {date}:
`{ver} <https://pypi.org/project/psut... | 1,406 | 25.055556 | 98 | py |
psutil | psutil-master/scripts/internal/purge_installation.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Purge psutil installation by removing psutil-related files and
directories found in site-packages directories. This is needed ma... | 1,026 | 22.883721 | 72 | py |
psutil | psutil-master/scripts/internal/winmake.py | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Shortcuts for various tasks, emulating UNIX "make" on Windows.
This is supposed to be invoked by "make.bat" and not used directl... | 17,952 | 27.272441 | 79 | py |
ffhq-features-dataset | ffhq-features-dataset-master/README.md | ## Gender, Age, and Emotions extracted for Flickr-Faces-HQ Dataset (FFHQ)



!... | 5,764 | 40.178571 | 797 | md |
ffhq-features-dataset | ffhq-features-dataset-master/extract_features.sh | mkdir ffhq
for i in {00000..69999}; do
date;
echo "$i";
curl -H "Ocp-Apim-Subscription-Key: <Your-Key-Here>" "<Your-Microsoft-Cognitive-Server-Here>/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes=age,gender,headPose,smile,facialHair,glasses,emotion,hair,makeup,occlusion,accessor... | 535 | 66 | 426 | sh |
null | Semi_REST-main/README.md | # Semi_REST | 11 | 11 | 11 | md |
rmsd | rmsd-master/.pre-commit-config.yaml | repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude: ^tests/resources/
- id: end-of-file-fixer
exclude: ^tests/resources/
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
- id... | 3,258 | 25.713115 | 150 | yaml |
rmsd | rmsd-master/environment.yml | name: rmsd-dev
channels:
- defaults
- conda-forge
dependencies:
- matplotlib
- mypy
- numpy
- pre-commit
- pylint
- pytest
- pytest-cov
- scipy
| 164 | 10.785714 | 15 | yml |
rmsd | rmsd-master/example.py | #!/usr/bin/env python
from pathlib import Path
import matplotlib.pyplot as plt # type: ignore
import numpy as np
from numpy import ndarray
import rmsd
def rotation_matrix(sigma: float) -> ndarray:
"""
https://en.wikipedia.org/wiki/Rotation_matrix
"""
radians = sigma * np.pi / 180.0
r11 = n... | 1,421 | 17.230769 | 62 | py |
rmsd | rmsd-master/setup.py | #!/usr/bin/env python
import os
import setuptools # type: ignore
__version__ = "1.5.1"
# Find the absolute path
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(here, "README.rst")) as f:
long_description = f.read()
short_description = (... | 1,343 | 26.428571 | 82 | py |
rmsd | rmsd-master/.github/workflows/publish.yml | name: Deploy PyPi Python Package on GitHub Releases
on:
release:
branches:
- master
jobs:
deploy:
name: Deploy Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.... | 718 | 22.966667 | 54 | yml |
rmsd | rmsd-master/.github/workflows/test.yml |
name: Test Python package
on:
push:
branches:
- '**'
pull_request:
branches: [ master ]
jobs:
test:
name: Testing
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- uses... | 798 | 19.487179 | 64 | yml |