This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An unpolished script to do pytest-bisection | |
# By this I don't mean bisecting a repository on commits using pytest, | |
# but rather bisecting the powerset of tests using pytest. | |
# In other words: | |
# This script takes a list of tests where the last one fails | |
# You already ran the test in isolation, but then the test passes | |
# Therefore some *other* test causes your test to fail | |
# This script finds the necessary preconditions that causes your test to fail | |
# I said "unpolished". You need to edit pytest_start and pytest_arg to match |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# find python classes that are declared once and then list files where the name is referenced | |
for candidate in \ | |
$(grep --exclude-dir=".git" --exclude-dir="__pycache__" -hoPR '^ *class \K[a-zA-Z0-9_]*' . | \ | |
sort | uniq -c | grep " 1 " | cut -c 9-) | |
do | |
REFERENCES=$(grep --exclude-dir=".git" --exclude-dir="__pycache__" -c -cR $candidate . | grep -v ":0") | |
if [ "$(wc -l <<< "$REFERENCES")" -eq "1" ]; then | |
if [[ $REFERENCES == *":1" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function | |
import re | |
import sys | |
re_close = re.compile(r"close\(([^)]+)\)") | |
re_open = re.compile(r'open\("([^"]+)"[^)]*\) += +([^ ]+)( .*)?') | |
open_files = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Modules/main.c b/Modules/main.c | |
index e3683b9..a60a5c9 100644 | |
--- a/Modules/main.c | |
+++ b/Modules/main.c | |
@@ -1238,7 +1238,7 @@ pymain_header(_PyMain *pymain) | |
return; | |
} | |
- fprintf(stderr, "Python %s on %s\n", Py_GetVersion(), Py_GetPlatform()); | |
+ fprintf(stderr, "Pie-thon %s on %s\n", Py_GetVersion(), Py_GetPlatform()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __ps1_git () { | |
# preserve exit status | |
local exit=$? | |
local repo_info | |
repo_info="$(git rev-parse --git-dir --is-inside-git-dir --is-inside-work-tree 2>/dev/null)" | |
if [ -z "$repo_info" ]; then | |
return $exit | |
fi | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function | |
import itertools | |
import operator | |
ops = {operator.add: '+', operator.sub: '-', operator.mul: '*', operator.truediv: '/'} | |
def run(a, b, c, d, op1, op2, op3, order): | |
try: | |
if order == 1: | |
return op1(a, op2(b, op3(c, d))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f | grep "\.\(py\|cc\|h\)$" | xargs -n 1 git blame -w -c -C | cut -d"(" -f 2 | cut -d")" -f 1 | sed -e "s/^\([a-zA-Z .]*\).*/\\1/" | sort | uniq -c | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py | |
python bootstrap.py --builder=dials hot update base build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting screen to work on a user account you su'd to. | |
function screen() { | |
/usr/bin/script -q -c "/usr/bin/screen ${*}" /dev/null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libtbx.python "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/modules/xia2_regression/test/xia2/tst_mad_example.py" dials [FAIL] | |
Time: 910.85 | |
Return code: 1 | |
OKs: 0 | |
Standard error: | |
Traceback (most recent call last): | |
File "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/build/../modules/xia2/command_line/xia2_main.py", line 282, in run | |
xinfo = xia2_main() | |
File "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/build/../modules/xia2/command_line/xia2_main.py", line 233, in xia2_main | |
Chatter.write(xinfo.get_output(), strip=False) |
NewerOlder