This file contains hidden or 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
#!/usr/bin/env bash | |
git checkout -b create-pr-from-script master | |
find .github/workflows -type f | xargs sed -i -- 's/string_before/string_after/g' | |
git commit -am "COMMIT MESSAGE" | |
gh pr create --title "PR TITLE" --assignee "@me" --body "PR BODY MESSAGE" | |
git checkout master |
This file contains hidden or 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
import dis | |
def func1(): | |
return {"x": 0, "y": 1} | |
def func2(): | |
return dict(x=0, y=1) | |
dis.dis(func1) | |
dis.dis(func2) |
This file contains hidden or 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
import numpy as np | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm | |
def main(): | |
capacity = 100 | |
throughput = np.array([50., 2.]) | |
decrease = np.array([2., 2.]) | |
increase = np.array([3., 3.]) |
This file contains hidden or 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
# usage: | |
# | |
# To find raises, simply run: | |
# $ python search_raise_in_except.py target.py | |
# | |
# In case you want to find raises in multiple files in current directory, run: | |
# $ for i in $(find . -type f -name "*.py"); do; python search_raise_in_except.py $i; done` | |
import _ast | |
import ast |