File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ __pycache__
2+ docs
3+ tests
4+ sample
5+ msal.egg-info
6+ msal
Original file line number Diff line number Diff line change 1+ # Prunes unwanted benchmark series from data.js
2+ import json , sys
3+
4+
5+ if len (sys .argv ) < 3 :
6+ sys .exit ("Usage: python prune.py <path_to_data.js> <name_1_to_be_removed> <name_2_to_be_removed> ..." )
7+ sys .exit (1 )
8+ js = open (sys .argv [1 ]).read ()
9+ header = "window.BENCHMARK_DATA = "
10+ assert js .startswith (header )
11+ data = json .loads (js [len (header ):])
12+ benchmark = []
13+ for commit in data ["entries" ]["Benchmark" ]:
14+ commit ["benches" ] = [
15+ bench for bench in commit ["benches" ]
16+ if bench ["name" ] not in sys .argv [2 :]]
17+ benchmark .append (commit )
18+ data ["entries" ]["Benchmark" ] = benchmark
19+ print (header , end = "" )
20+ print (json .dumps (data , indent = 2 )) # It is great that modern Python keeps the order of keys
Original file line number Diff line number Diff line change 1+ Hello World
You can’t perform that action at this time.
0 commit comments