id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
27,900
hsw_client_ratios.py
andikleen_pmu-tools/hsw_client_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel 4rd gen Core (code named Haswell) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysismethods/y...
117,322
Python
.py
2,939
34.275264
423
0.657544
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,901
skl_client_ratios.py
andikleen_pmu-tools/skl_client_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel 6th/7th gen Core (code named Skykale/Kabylake/Coffeelake) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.co...
230,237
Python
.py
5,343
37.149916
1,761
0.655937
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,902
objutils.py
andikleen_pmu-tools/objutils.py
# generic utilities for objects def has(obj, name): return name in obj.__class__.__dict__ def safe_ref(obj, name): if has(obj, name): return obj.__class__.__dict__[name] return None def ref_or(obj, name, alt): if has(obj, name): return obj.__class__.__dict__[name] return alt def ...
445
Python
.py
15
24.933333
43
0.629108
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,903
event-rmap.py
andikleen_pmu-tools/event-rmap.py
#!/usr/bin/env python3 # print currently running events on cpu (default 0) # event-rmap [cpu-num] # xxx no extra modi for now, racy with multi plexing from __future__ import print_function import sys import msr import ocperf from pmudef import (MSR_PEBS_ENABLE, MSR_EVNTSEL, EVENTSEL_ENABLE, EVMASK, ...
2,961
Python
.py
88
23.761364
99
0.502614
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,904
adl_grt_ratios.py
andikleen_pmu-tools/adl_grt_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 3.51 description for Intel 12th gen Core (code name Alderlake) with GraceMont # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysism...
68,772
Python
.py
2,004
28.078842
211
0.618823
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,905
skx_server_ratios.py
andikleen_pmu-tools/skx_server_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel Xeon Scalable Processors (code named Skylake Server) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/sit...
244,262
Python
.py
5,556
38.026278
2,229
0.657624
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,906
mtl_cmt_ratios.py
andikleen_pmu-tools/mtl_cmt_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 3.51 description for Intel 14th gen Core (code name Meteorlake) with Crestmont # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysis...
67,922
Python
.py
1,984
27.995968
215
0.618673
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,907
adl_glc_ratios.py
andikleen_pmu-tools/adl_glc_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel 12th gen Core (code name Alderlake) with Golden Cove # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/sit...
244,918
Python
.py
5,674
37.201269
1,765
0.655639
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,908
metrics.py
andikleen_pmu-tools/metrics.py
#Base classes for different metrics print_error = lambda msg: False class MetricBase(object): # Derived classes can override these level = 0 name = "" domain = "" area = "" htoff = False sample = [] sibling = None metricgroup = frozenset([]) desc = "Missing description" de...
7,887
Python
.py
177
36.016949
76
0.642495
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,909
spr_max_server_ratios.py
andikleen_pmu-tools/spr_max_server_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel Xeon Scalable Processors 4th gen MAX (code name Sapphire Rapids) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.go...
273,481
Python
.py
6,251
37.783875
1,927
0.65589
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,910
ivb_client_ratios.py
andikleen_pmu-tools/ivb_client_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel 3rd gen Core (code named IvyBridge) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysismethods...
127,185
Python
.py
3,171
34.451908
306
0.656546
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,911
interval-merge.py
andikleen_pmu-tools/interval-merge.py
#!/usr/bin/env python3 # merge multiple --perf-output files. requires header from __future__ import print_function import csv import argparse from collections import OrderedDict, Counter import sys ap = argparse.ArgumentParser() ap.add_argument('csvfiles', nargs='+', type=argparse.FileType('r')) args = ap.parse_args()...
1,764
Python
.py
52
26.461538
89
0.552693
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,912
listutils.py
andikleen_pmu-tools/listutils.py
# generic utilities for lists import sys from itertools import chain if sys.version_info.major == 3: from itertools import zip_longest else: from itertools import izip_longest zip_longest = izip_longest def flatten(x): return list(chain(*x)) def filternot(p, l): return list(filter(lambda x: not p...
1,302
Python
.py
49
21.367347
69
0.607401
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,913
tl-serve.py
andikleen_pmu-tools/tl-serve.py
#!/usr/bin/env python3 # serve toplev csv file as http using dygraph # toplev.py -I100 -o x.csv -v -x, ... # tl-serve.py x.csv [host [port]] from __future__ import print_function import string import argparse import csv import re import os import signal import sys try: import BaseHTTPServer except ImportError: ...
9,872
Python
.py
296
26.939189
110
0.573286
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,914
frequency.py
andikleen_pmu-tools/frequency.py
nominal_freq = 1.0 class Frequency: name = "Frequency" desc = " Frequency ratio" subplot = "Frequency" domain = "CoreMetric" def compute(self, EV): try: self.val = (EV("cycles", 1) / EV("CPU_CLK_UNHALTED.REF_TSC", 1)) * nominal_freq except ZeroDivisionError: ...
504
Python
.py
17
22.588235
91
0.584711
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,915
gen-dot.py
andikleen_pmu-tools/gen-dot.py
#!/usr/bin/env python3 # generate dot diagram of top down tree from module from __future__ import print_function import sys max_level = 5 first = 1 if sys.argv[1:] and sys.argv[1][:2] == "-l": max_level = int(sys.argv[1][2:]) first += 1 if len(sys.argv) > first and sys.argv[first] == "simple": import simpl...
1,118
Python
.py
40
22.575
66
0.569561
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,916
clx_server_ratios.py
andikleen_pmu-tools/clx_server_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel Xeon Scalable Processors 2nd gen (code named Cascade Lake) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.c...
249,635
Python
.py
5,708
37.797828
1,906
0.656699
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,917
icx_server_ratios.py
andikleen_pmu-tools/icx_server_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel Xeon Scalable Processors 3rd gen (code name Icelake Server) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google....
254,370
Python
.py
5,811
37.822406
1,942
0.65704
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,918
csv_formats.py
andikleen_pmu-tools/csv_formats.py
# distinguish the bewildering variety of perf/toplev CSV formats from __future__ import print_function import sys import re from collections import namedtuple def is_val(n): return re.match(r'-?[0-9.]+%?|<.*>', n) is not None def is_cpu(n): return re.match(r'(CPU)|(S\d+(-C\d+)?)|C\d+|all', n) is not None def...
4,094
Python
.py
106
33.009434
105
0.585747
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,919
interval-plot.py
andikleen_pmu-tools/interval-plot.py
#!/usr/bin/env python3 # plot interval CSV output from perf/toplev # perf stat -I1000 -x, -o file ... # toplev -I1000 -x, -o file ... # interval-plot.py file (or stdin) # delimeter must be , # this is for data that is not normalized # TODO: move legend somewhere else where it doesn't overlap? from __future__ import pri...
4,454
Python
.py
132
29.022727
104
0.635097
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,920
snb_client_ratios.py
andikleen_pmu-tools/snb_client_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel 2nd gen Core (code named SandyBridge) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysismetho...
64,349
Python
.py
1,608
34.54291
306
0.666219
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,921
ehl_ratios.py
andikleen_pmu-tools/ehl_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 2.0 description for Intel Elkhart Lake # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysismethods/yasin-pubs # https://download.01...
40,880
Python
.py
1,221
27.366093
165
0.62374
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,922
hsx_server_ratios.py
andikleen_pmu-tools/hsx_server_ratios.py
# -*- coding: latin-1 -*- # # auto generated TopDown/TMA 4.8-full-perf description for Intel Xeon E5 v3 (code Named Haswell EP) # Please see http://ark.intel.com for more details on these CPUs. # # References: # http://bit.ly/tma-ispass14 # http://halobates.de/blog/p/262 # https://sites.google.com/site/analysismethods/...
123,862
Python
.py
3,072
34.670247
423
0.657931
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,923
pmumon.py
andikleen_pmu-tools/pmumon.py
#!/usr/bin/env python3 # standalone simple pmu configuration tool # allows to count an even without using perf # will conflict with any parallel perf (and other profiler) # usage. # Author: Andi Kleen # from __future__ import print_function import os import struct import sys def writemsr(msr, val, cpu): f = os.ope...
1,339
Python
.py
39
31.153846
83
0.664093
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,924
pmudef.py
andikleen_pmu-tools/pmudef.py
EVENTSEL_EVENT = 0x00ff EVENTSEL_UMASK = 0xff00 EVENTSEL_EDGE = 1<<18 EVENTSEL_PC = 1<<19 EVENTSEL_ANY = 1<<21 EVENTSEL_INV = 1<<23 EVENTSEL_CMASK = 0xff000000 EVMASK = (EVENTSEL_EVENT | EVENTSEL_UMASK | EVENTSEL_EDGE | EVENTSEL_PC | EVENTSEL_ANY | EVENTSEL_INV | EVENTSEL_CMASK) EVENTSEL_ENABLE = 1<...
738
Python
.py
26
25.307692
88
0.682203
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,925
event-translate.py
andikleen_pmu-tools/event-translate.py
#!/usr/bin/env python3 # translate raw events to names # event-translate rXXX ... from __future__ import print_function import re import sys import ocperf from pmudef import EVMASK, EVENTSEL_EVENT, EVENTSEL_UMASK, extra_flags emap = ocperf.find_emap() if not emap: sys.exit("Unknown CPU or cannot find event table")...
1,194
Python
.py
35
24.971429
83
0.525043
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,926
plot-normalized.py
andikleen_pmu-tools/plot-normalized.py
#!/usr/bin/env python3 # plot already normalized data # first column is time stamp import sys import argparse import os import csv import matplotlib if os.getenv("DISPLAY") is None: matplotlib.use('Agg') import matplotlib.pyplot as plt ap = argparse.ArgumentParser(usage='Plot already normalized CSV data') ap.add_...
1,129
Python
.py
44
21.25
81
0.637627
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,927
node.py
andikleen_pmu-tools/node.py
# Helper classes and functions for nodes # Decorator class to declare reference dependecies between classes class requires(object): """Decorator to mark required references. These references will be added to the object as instance attributes. Example: @requires("ref1", "ref2") class SomeClass(object):...
1,923
Python
.py
49
32.204082
75
0.656099
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,928
perf_metrics.py
andikleen_pmu-tools/perf_metrics.py
class CPU_Utilization: name = "CPU utilization" desc = """ Number of CPUs used. The top down CPU metrics are only meaningful when a CPU thread is executing. The percentage are always relative to the executing time. When the utilization is low the workload may actually not be CPU bound, but IO (network, block) ...
1,179
Python
.py
33
30.515152
80
0.657043
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,929
slm_ratios.py
andikleen_pmu-tools/slm_ratios.py
# # Silvermont top level model # Can be collected without multiplexing # Please see http://ark.intel.com for more details on these CPUs. # from __future__ import print_function import metrics import node print_error = lambda msg: False version = "1.0" # Override using set_clks_event_name() CLKS_EVENT_NAME = "CPU_CLK_...
6,771
Python
.py
188
28.356383
78
0.620642
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,930
latego.py
andikleen_pmu-tools/latego.py
#!/usr/bin/env python3 # configure latego workaround on Sandy Bridge EP # can be run as a standalone tool or used as module # latego enable|disable hexevent from __future__ import print_function import signal import struct import re import os import msr import pci busses = (0x3f, 0x7f, 0xbf, 0xff) def local_direct2co...
3,280
Python
.py
109
24.284404
65
0.607154
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,931
ocperf.py
andikleen_pmu-tools/ocperf.py
#!/usr/bin/env python3 # Copyright (c) 2011-2020, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distribu...
41,470
Python
.py
1,122
27.148841
152
0.523352
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,932
tl_io.py
andikleen_pmu-tools/tl_io.py
# Copyright (c) 2020, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope it will be u...
2,853
Python
.py
88
27.931818
93
0.659505
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,933
tl_output.py
andikleen_pmu-tools/tl_output.py
# Copyright (c) 2012-2020, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope it will...
18,928
Python
.py
475
29.454737
106
0.540833
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,934
tl_uval.py
andikleen_pmu-tools/tl_uval.py
# Copyright (c) 2018 Technical University of Munich # Author: Martin Becker # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the ho...
7,505
Python
.py
201
29.129353
106
0.566396
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,935
list-events.py
andikleen_pmu-tools/list-events.py
#!/usr/bin/env python3 # print all events in a eventmap from __future__ import print_function import sys import ocperf emap = ocperf.find_emap() if not emap: sys.exit("Unknown CPU or cannot find event table") for j in sorted(emap.events): print(j)
256
Python
.py
10
23.8
54
0.752033
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,936
linux_metrics.py
andikleen_pmu-tools/linux_metrics.py
# # basic linux software metrics # # for most of these it would be much nicer to measure durations, but # perf stat doesn't support that # from __future__ import print_function import os, sys class CS: name = "Context switches" desc = " Number of context switches between threads or processes on a CPU." nog...
5,903
Python
.py
174
27.448276
117
0.622724
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,937
knl_ratios.py
andikleen_pmu-tools/knl_ratios.py
import metrics import node import slm_ratios as slm version = "1.0" slm.set_clks_event_name("CPU_CLK_UNHALTED.THREAD") smt_enabled = False class CyclesPerUop(slm.CyclesPerUop): pass # LEVEL 1 class FrontendBound(slm.FrontendBound): pass class BackendBound(slm.BackendBound): pass class BadSpeculation(...
2,492
Python
.py
68
26.323529
77
0.595754
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,938
fake-perf.py
andikleen_pmu-tools/fake-perf.py
#!/usr/bin/env python3 # mock perf for limited test environments from __future__ import print_function import sys out = sys.stderr av = sys.argv if av[-1] == "true": sys.exit(0) j = 1 process = True while j < len(sys.argv): if av[j] == "--version": print("perf version 5.6.8", end='') break ...
473
Python
.py
21
18.619048
43
0.56541
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,939
pfeat.py
andikleen_pmu-tools/parser/pfeat.py
# print perf headers def print_feat(feat): print("# Measured on %s (%s)" % ( feat.hostname.hostname, feat.osrelease.osrelease)) print("# %s, %s" % ( feat.cpudesc.cpudesc, feat.cpuid.cpuid)) print("# %s" % (" ".join(map(lambda x: x.cmdline, feat.cmdline.cmdlin...
326
Python
.py
9
28.444444
78
0.556962
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,940
elf.py
andikleen_pmu-tools/parser/elf.py
#!/usr/bin/env python # resolve ELF and DWARF symbol tables using elftools # # Copyright (c) 2013-2014, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the ...
4,257
Python
.py
124
26.629032
75
0.607967
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,941
util.py
andikleen_pmu-tools/parser/util.py
# utility functions import bisect def find_le(f, key): pos = bisect.bisect_left(f, (key,)) if pos < len(f) and f[pos][0] == key: return f[pos] if pos == 0: return None return f[pos - 1]
220
Python
.py
9
19.666667
41
0.578947
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,942
perfpd.py
andikleen_pmu-tools/parser/perfpd.py
#!/usr/bin/env python # Import perf.data into a pandas DataFrame # # Copyright (c) 2013-2014, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Softw...
6,496
Python
.py
186
27.408602
79
0.584726
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,943
kernel.py
andikleen_pmu-tools/parser/kernel.py
#!/usr/bin/env python # resolve kernel symbols through kallsyms (when no vmlinux is available) # # Copyright (c) 2014, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as pu...
966
Python
.py
29
29.413793
75
0.691318
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,944
perfdata.py
andikleen_pmu-tools/parser/perfdata.py
#!/usr/bin/env python # A description of the perf.data file format in "construct" # # Copyright (c) 2011-2013, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published ...
30,404
Python
.py
629
23.766296
82
0.357525
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,945
hist.py
andikleen_pmu-tools/parser/hist.py
#!/usr/bin/env python # print histogram for perf.data from __future__ import print_function import perfpd import pfeat import argparse p = argparse.ArgumentParser(description='Print histogram for perf.data') p.add_argument('datafiles', nargs='*', help='perf.data files (default perf.data)', ...
1,271
Python
.py
35
31.228571
77
0.636585
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,946
mmap.py
andikleen_pmu-tools/parser/mmap.py
# track mmap updates in a perf stream and allow lookup of symbols # # Copyright (c) 2013-2014, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Soft...
2,751
Python
.py
70
30.728571
77
0.579125
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,947
topdown-csv.py
andikleen_pmu-tools/topdown-csv/topdown-csv.py
#!/usr/bin/env python3 # Copyright (c) 2012-2024, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distribu...
37,164
Python
.py
1,076
27.273234
149
0.548789
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,948
mock.py
andikleen_pmu-tools/topdown-csv/mock.py
#!/usr/bin/env python3 # Do basic python sanity check of translation output import sys sys.path.append(".") import t l = [] m = [] def pev(e): print("\t",e) return 1 class R: def run(self, p): #print p l.append(p) def metric(self, p): m.append(p) t.Setup(R()) for p in l: p...
629
Python
.py
29
17.62069
69
0.584874
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,949
ucevent.py
andikleen_pmu-tools/ucevent/ucevent.py
#!/usr/bin/env python # Copyright (c) 2013, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in...
35,405
Python
.py
1,032
25.651163
101
0.539862
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,950
ucmsg.py
andikleen_pmu-tools/ucevent/ucmsg.py
# Handle warnings and errors # Separate module to avoid circular imports from __future__ import print_function import sys import fnmatch quiet = False debug = None def debug_msg(x, y): if debug and any(map(lambda p: fnmatch.fnmatch(x, p), debug.split(","))): print("debug:", x + ": " + str(y), file=sys.std...
406
Python
.py
13
28.153846
77
0.682051
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,951
bdxde_uc.py
andikleen_pmu-tools/ucevent/bdxde_uc.py
# BDXDE bdxde_uc_events.v1.00p bdxde_uc_derived.v1.00p # aliases aliases = { "PCUFilter": "PCU_MSR_PMON_BOX_FILTER", "HA_AddrMatch0": "HAn_PCI_PMON_BOX_ADDRMATCH0", "IRPFilter": "IRP_PCI_PMON_BOX_FILTER", "HA_AddrMatch1": "HAn_PCI_PMON_BOX_ADDRMATCH1", "HA_OpcodeMatch": "HAn_PCI_PMON_BOX_OPCO...
439,736
Python
.py
9,595
35.927671
842
0.560947
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,952
ivt_extra.py
andikleen_pmu-tools/ucevent/ivt_extra.py
extra_derived = { # CBO "CBO.LLC_PCIE_MEM_WRITE_BYTES": { "Box": "CBO", "Category": "CBO TOR Events", "Defn": "LLC Miss Data from PCIe to memory written", "Desc": "LLC Miss Data from PCIe to memory written", "Equation": "TOR_INSERTS.OPCODE with:Cn_MSR_PMON_BOX_FILT...
7,755
Python
.py
101
67.455446
526
0.668279
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,953
jkt_extra.py
andikleen_pmu-tools/ucevent/jkt_extra.py
extra_derived = { # CBO "CBO.LLC_PCIE_MEM_WRITE_BYTES": { "Box": "CBO", "Category": "CBO TOR Events", "Defn": "LLC Miss Data from PCIe to memory written", "Desc": "LLC Miss Data from PCIe to memory written", "Equation": "TOR_INSERTS.OPCODE with:Cn_MSR_PMON_BOX_FILT...
7,755
Python
.py
101
67.455446
526
0.668279
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,954
icx_uc.py
andikleen_pmu-tools/ucevent/icx_uc.py
# ICX icx_uc_events.v1.00p.txt icx_uc_derived.v1.00p.txt # aliases aliases = { "M2MAddrMask0": "M2M{i}_PCI_PMON_ADDRMASK0", "UBoxFilter": "U_MSR_PMON_BOX_FILTER", "M2MAddrMatch0": "M2M{i}_PCI_PMON_ADDRMATCH1", "M2MAddrMask1": "M2M{i}_PCI_PMON_ADDRMASK1", "CHAFilter": "C{i}_MSR_PMON_BOX_FILTER"...
1,953,071
Python
.py
44,101
39.898528
1,355
0.659866
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,955
hsx_uc.py
andikleen_pmu-tools/ucevent/hsx_uc.py
# HSX hsxuc_events.v1.00p hsxuc_derived.v1.00p # aliases aliases = { "QPIRxMatch1": "Q_Py_PCI_RX_PMON_BOX_MATCH1", "QPIRxMask1": "Q_Py_PCI_RX_PMON_BOX_MASK1", "IRPFilter": "IRP_PCI_PMON_BOX_FILTER", "PCUFilter": "PCU_MSR_PMON_BOX_FILTER", "QPIRxMask0": "Q_Py_PCI_RX_PMON_BOX_MASK0", "CBoFi...
722,780
Python
.py
13,911
42.053339
1,159
0.584945
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,956
bdx_uc.py
andikleen_pmu-tools/ucevent/bdx_uc.py
# BDX bdx_uc_events.v0.60p bdx_uc_derived.v0.60p # aliases aliases = { "IRPFilter": "IRP_PCI_PMON_BOX_FILTER", "UBoxFilter": "U_MSR_PMON_BOX_FILTER", "PCUFilter": "PCU_MSR_PMON_BOX_FILTER", "HA_AddrMatch0": "HAn_PCI_PMON_BOX_ADDRMATCH0", "QPITxMatch1": "Q_Py_PCI_TX_PMON_BOX_MATCH1", "CBoF...
724,764
Python
.py
13,955
42.014547
1,158
0.584658
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,957
ucexpr.py
andikleen_pmu-tools/ucevent/ucexpr.py
# Copyright (c) 2013, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope it will be u...
11,817
Python
.py
367
23.542234
92
0.464927
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,958
md2hman.py
andikleen_pmu-tools/ucevent/md2hman.py
#!/usr/bin/env python # convert README.md to include files for help2man from __future__ import print_function import sys import re skip_sections = ( "Command Line options reference", "Debugging and testing", "Support", "Author", "Other Projects providing uncore monitoring") tabmode = False skip = False for ...
1,297
Python
.py
46
21.369565
87
0.484388
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,959
sanity-run.py
andikleen_pmu-tools/ucevent/sanity-run.py
#!/usr/bin/env python # sanity check an event # percent between 0 and 100% # nothing negative from __future__ import print_function import sys import os import pipes logfile = "slog.%d" % (os.getpid()) s = "./ucevent.py -x, -o " + logfile + " " + " ".join(map(pipes.quote, sys.argv[1:])) w = os.getenv("WRAP") if w: ...
957
Python
.py
36
21.333333
85
0.55131
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,960
ivt_uc.py
andikleen_pmu-tools/ucevent/ivt_uc.py
# IVT ivtuc_events.v0.85p ivtuc_derived.v0.85p # aliases aliases = { "HA_OpcodeMatch": "HAn_PCI_PMON_BOX_OPCODEMATCH", "QPIMatch1": "Q_Py_PCI_PMON_BOX_MATCH1", "QPIMask0": "Q_Py_PCI_PMON_BOX_MASK0", "HA_AddrMatch1": "HAn_PCI_PMON_BOX_ADDRMATCH1", "QPIMatch0": "Q_Py_PCI_PMON_BOX_MATCH0", "...
643,426
Python
.py
11,174
47.662341
1,158
0.602252
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,961
jkt_uc.py
andikleen_pmu-tools/ucevent/jkt_uc.py
# Support for Intel Xeon E5 2600 series uncore monitoring # see http://www.intel.com/content/dam/www/public/us/en/documents/design-guides/xeon-e5-2600-uncore-guide.pdf # for more details on the events and formulas. # aliases aliases = { "QPIMatch1": "Q_Py_PCI_PMON_PKT_MATCH1", "QPIMask0": "Q_Py_PCI_PMON_PKT_...
350,803
Python
.py
5,162
58.176095
1,362
0.634063
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,962
uctopy.pl
andikleen_pmu-tools/ucevent/uctopy.pl
#!/usr/bin/perl # generate python data files from perl input # uctopl.pl CPU-ACRONYM events.pl derived.pl >cpu_uc.py use File::Basename; $cpu = $ARGV[0]; shift(@ARGV); foreach (@ARGV) { do $_; } $code = <<END; \$aliases = \\%CPU_UCFilterAliases; \$events = \\%CPU_UCEventList; \$derived = \\%CPU_UCDerivedList; END $c...
2,989
Python
.py
124
21.862903
70
0.523558
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,963
skx_uc.py
andikleen_pmu-tools/ucevent/skx_uc.py
# SKX skx_uc_events.v0.50p.txt skx_uc_derived.v0.50p.txt # aliases aliases = { "CHAFilter1": "C{i}_MSR_PMON_BOX_FILTER1", "M2MAddrMask0": "M2M{i}_PCI_PMON_ADDRMASK0", "M2MAddrMask1": "M2M{i}_PCI_PMON_ADDRMASK1", "M2MOpcMask": "M2M{i}_PCI_PMON_OPCMASK", "M2MAddrMatch0": "M2M{i}_PCI_PMON_ADDRMA...
1,242,861
Python
.py
26,676
36.707115
843
0.568509
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,964
bdx_extra.py
andikleen_pmu-tools/ucevent/bdx_extra.py
extra_derived = { # CBO "CBO.LLC_PCIE_MEM_WRITE_BYTES": { "Box": "CBO", "Category": "CBO TOR Events", "Defn": "LLC Miss Data from PCIe to memory written", "Desc": "LLC Miss Data from PCIe to memory written", "Equation": "TOR_INSERTS.OPCODE with:Cn_MSR_PMON_BOX_FILT...
7,755
Python
.py
101
67.455446
526
0.668279
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,965
ucaux.py
andikleen_pmu-tools/ucevent/ucaux.py
class Aux: limited_counters = { "r3qpi": 3, "ubox": 2 } filters = ("filter_nid", "mask", "match", "filter_opc", "filter_state") DEFAULT_COUNTERS = 4 MAX_RANK = 8 acronyms = { "TOR": "Table of Requests, pending transactions", "FLIT": "80-bit QPI packet", "RPQ": "Read Queue", ...
3,702
Python
.py
88
33.738636
75
0.550014
andikleen/pmu-tools
1,984
331
178
GPL-2.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,966
setup.py
aerkalov_ebooklib/setup.py
import io import re from setuptools import setup def read(path): with io.open(path, mode="r", encoding="utf-8") as fd: content = fd.read() # Convert Markdown links to reStructuredText links return re.sub(r"\[([^]]+)\]\(([^)]+)\)", r"`\1 <\2>`_", content) setup( name = 'EbookLib', versio...
1,359
Python
.py
36
31.944444
81
0.615793
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,967
create.py
aerkalov_ebooklib/samples/09_create_image/create.py
# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('image123') book.set_title('Simple book with image') book.set_language('en') book.add_author('Aleksandar Erkalovic') # chapter with image c1 = epub.EpubHtml...
1,188
Python
.py
35
29.057143
119
0.651982
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,968
create.py
aerkalov_ebooklib/samples/05_plugins_create/create.py
# coding=utf-8 from ebooklib import epub from ebooklib.plugins.base import BasePlugin class SamplePlugin(BasePlugin): NAME = 'Sample Plugin' # Very useless but example of what can be done def html_before_write(self, book, chapter): if chapter.content is None: return try: ...
2,969
Python
.py
80
30.3875
174
0.632624
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,969
create.py
aerkalov_ebooklib/samples/07_pagebreaks/create.py
# coding=utf-8 from ebooklib import epub from ebooklib.plugins import standard from ebooklib.utils import create_pagebreak if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_auth...
1,904
Python
.py
40
42.55
207
0.684582
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,970
parse.py
aerkalov_ebooklib/samples/06_parse/parse.py
import sys import ebooklib from ebooklib import epub from ebooklib.utils import debug book = epub.read_epub(sys.argv[1]) debug(book.metadata) debug(book.spine) debug(book.toc) for x in book.get_items_of_type(ebooklib.ITEM_IMAGE): debug(x) for x in book.get_items_of_type(ebooklib.ITEM_DOCUMENT): debug(x)
320
Python
.py
12
24.583333
57
0.782178
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,971
create.py
aerkalov_ebooklib/samples/02_cover_create/create.py
# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # add cover image book.set_cover("image.jpg", ...
2,160
Python
.py
62
29.532258
162
0.632012
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,972
epub2markdown.py
aerkalov_ebooklib/samples/04_markdown_parse/epub2markdown.py
#!/usr/bin/env python import os.path import subprocess import sys from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path.basename(os...
1,255
Python
.py
30
32.266667
84
0.580937
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,973
create.py
aerkalov_ebooklib/samples/03_advanced_create/create.py
# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # intro chapter c1 = epub.EpubHtml(title='Intr...
2,380
Python
.py
67
30.179104
142
0.645897
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,974
create.py
aerkalov_ebooklib/samples/08_SMIL/create.py
# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_metadata(None, 'meta', 'Naro Narrator', {'property': 'media:narrator'}) book.add_me...
1,649
Python
.py
30
49.733333
246
0.666667
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,975
parse.py
aerkalov_ebooklib/samples/08_SMIL/parse.py
import sys import ebooklib from ebooklib import epub from ebooklib.utils import debug book = epub.read_epub(sys.argv[1]) debug(book.metadata) debug(book.spine) debug(book.toc) debug('================================') debug('SMIL') for x in book.get_items_of_type(ebooklib.ITEM_SMIL): debug(x) debug('========...
556
Python
.py
18
28.611111
65
0.596987
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,976
create.py
aerkalov_ebooklib/samples/01_basic_create/create.py
# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # intro chapter c1 = epub.EpubHtml(title='Intr...
1,965
Python
.py
59
27.983051
142
0.632392
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,977
conf.py
aerkalov_ebooklib/docs/conf.py
# -*- coding: utf-8 -*- # # EbookLib documentation build configuration file, created by # sphinx-quickstart on Fri Apr 25 11:49:49 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
9,313
Python
.py
209
43.07177
148
0.729167
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,978
utils.py
aerkalov_ebooklib/ebooklib/utils.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
3,206
Python
.py
81
32.790123
96
0.659498
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,979
__init__.py
aerkalov_ebooklib/ebooklib/__init__.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
1,509
Python
.py
42
31.5
77
0.643199
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,980
epub.py
aerkalov_ebooklib/ebooklib/epub.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
58,456
Python
.py
1,335
31.545318
244
0.539781
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,981
sourcecode.py
aerkalov_ebooklib/ebooklib/plugins/sourcecode.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
2,481
Python
.py
50
40.58
118
0.646498
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,982
standard.py
aerkalov_ebooklib/ebooklib/plugins/standard.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
12,534
Python
.py
200
43.785
156
0.492808
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,983
base.py
aerkalov_ebooklib/ebooklib/plugins/base.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
1,546
Python
.py
40
33.425
77
0.706079
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,984
booktype.py
aerkalov_ebooklib/ebooklib/plugins/booktype.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
4,359
Python
.py
87
38.850575
179
0.579245
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,985
tidyhtml.py
aerkalov_ebooklib/ebooklib/plugins/tidyhtml.py
# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com> # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
2,317
Python
.py
61
31.508197
77
0.658166
aerkalov/ebooklib
1,451
226
102
AGPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,986
setup.py
stan-dev_pystan2/setup.py
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013-2015, PyStan developers # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #----------------------------------------------------...
11,312
Python
.py
262
35.591603
121
0.597019
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,987
_compat.py
stan-dev_pystan2/pystan/_compat.py
# -*- coding: utf-8 -*- """ py2/py3 compatibility support drawn from jinja2 see http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ """ import sys PY2 = sys.version_info[0] == 2 _identity = lambda x: x if not PY2: unichr = chr range_type = range text_type = str string_types = (str,) i...
717
Python
.py
27
22.222222
64
0.638235
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,988
_misc.pyx
stan-dev_pystan2/pystan/_misc.pyx
# cython: language_level=2 import cython import numpy as np @cython.boundscheck(False) @cython.wraparound(False) cpdef get_kept_samples(int n, dict sim): """See documentation in misc.py""" cdef int i, j, num_chains, num_samples, num_warmup, ss_index, s_index cdef double[:] s, ss cdef long[:] perm ...
1,606
Python
.py
44
30.545455
73
0.617268
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,989
_api.pyx
stan-dev_pystan2/pystan/_api.pyx
# distutils: language = c++ # cython: language_level=2 #----------------------------------------------------------------------------- # Copyright (c) 2013, Allen B. Riddell # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #--------------------------...
1,234
Python
.py
28
38.75
78
0.609129
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,990
chains.py
stan-dev_pystan2/pystan/chains.py
import pystan._chains as _chains from numpy import nan def ess(sim, n): """Calculate effective sample size Parameters ---------- sim : chains n : int Parameter index starting from 0 """ try: ess = _chains.effective_sample_size(sim, n) except (ValueError, ZeroDivisionErr...
885
Python
.py
34
20.705882
69
0.629147
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,991
stanfit4model.pyx
stan-dev_pystan2/pystan/stanfit4model.pyx
# distutils: language = c++ # cython: language_level=2 #----------------------------------------------------------------------------- # Copyright (c) 2013, Allen B. Riddell # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #--------------------------...
44,032
Python
.py
902
40.179601
157
0.62753
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,992
_chains.pyx
stan-dev_pystan2/pystan/_chains.pyx
#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False from libcpp.vector cimport vector from libc.math cimport sqrt cimport cython import numpy as np import pystan.constants # autocovariance is a template function, which Cython doesn't yet support cdef extern from "stan/math/prim/fun/autoc...
7,872
Python
.py
201
33.159204
112
0.637843
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,993
constants.py
stan-dev_pystan2/pystan/constants.py
MAX_UINT = 2**31 - 1 # conservative choice, maximum unsigned int on 32-bit Python 2.7 try: from enum import Enum # Python 3.4 except ImportError: from pystan.external.enum import Enum sampling_algo_t = Enum('sampling_algo_t', 'NUTS HMC Metropolis Fixed_param', module=__name__) variational_algo_t = Enum('var...
645
Python
.py
13
46.692308
108
0.712919
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,994
plots.py
stan-dev_pystan2/pystan/plots.py
import numpy as np import logging logger = logging.getLogger('pystan') def traceplot(fit, pars, dtypes, **kwargs): """ Use pymc's traceplot to display parameters. Additional arguments are passed to pymc.plots.traceplot. """ # FIXME: eventually put this in the StanFit object # FIXME: write a ...
1,048
Python
.py
24
37.25
118
0.667647
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,995
api.py
stan-dev_pystan2/pystan/api.py
#----------------------------------------------------------------------------- # Copyright (c) 2013-2015, PyStan developers # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #---------------------------------------------------------------------------...
17,919
Python
.py
373
40.262735
120
0.634308
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,996
__init__.py
stan-dev_pystan2/pystan/__init__.py
#----------------------------------------------------------------------------- # Copyright (c) 2013-2015 PyStan developers # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #----------------------------------------------------------------------------...
822
Python
.py
19
41.894737
78
0.64375
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,997
diagnostics.py
stan-dev_pystan2/pystan/diagnostics.py
import pystan from pystan.misc import _check_pars, _remove_empty_pars from pystan._compat import string_types import numpy as np import logging logger = logging.getLogger('pystan') # Diagnostics modified from Betancourt's stan_utility.py module def check_div(fit, verbose=True, per_chain=False): """Check for tran...
17,940
Python
.py
403
33.364764
126
0.581097
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,998
model.py
stan-dev_pystan2/pystan/model.py
#----------------------------------------------------------------------------- # Copyright (c) 2013-2015, PyStan developers # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #---------------------------------------------------------------------------...
43,933
Python
.py
874
38.479405
248
0.595576
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)
27,999
misc.py
stan-dev_pystan2/pystan/misc.py
"""PyStan utility functions These functions validate and organize data passed to and from the classes and functions defined in the file `stan_fit.hpp` and wrapped by the Cython file `stan_fit.pxd`. """ #----------------------------------------------------------------------------- # Copyright (c) 2013-2015, PyStan dev...
58,254
Python
.py
1,283
37.081839
117
0.592985
stan-dev/pystan2
921
191
0
GPL-3.0
9/5/2024, 5:13:50 PM (Europe/Amsterdam)