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 gevent import monkey # isort:skip | |
monkey.patch_all() # isort:skip | |
from collections import defaultdict | |
from typing import List | |
import gevent | |
from gevent.event import Event | |
from matrix_client.errors import MatrixRequestError |
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
"""Types used to represent transaction and its states. | |
Each state of a transaction is described by a different wrapper dataclass, this | |
is used to introduce new fields in a type safe manner, and to enforce correct | |
usage. | |
Transactions are by design immutable and don't have access in their field to | |
objects that do IO, that is why the RPC class is given as an argument to each | |
method, when necessary. | |
""" |
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
#!/usr/bin/env python | |
import json | |
import sys | |
from collections import defaultdict | |
from raiden.storage.sqlite import SQLiteStorage | |
def read_args(): | |
if len(sys.argv) < 2 or "-h" in sys.argv or "--help" in sys.argv: |
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
#!/usr/bin/env sh | |
# pytest executable | |
PYTEST=${PYTEST:-$(which pytest)} | |
# specify non temp output directory | |
OUT_DIR=${OUT_DIR:-$(mktemp -d)} | |
# which tests to execute | |
SUITE=${SUITE:-raiden/tests/unit raiden/tests/fuzz} | |
# report only these files | |
ONLY=${ONLY:-*} |
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 itertools import count | |
import gevent | |
from gevent.event import AsyncResult | |
def wait_twice(async_result): | |
print('wait_twice enter') | |
gevent.joinall(set([async_result, async_result]), raise_error=True) | |
print('wait_twice exit') |
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
# When Tab is pressed on an empty(!) command line, the contents of the | |
# directory are printed (`ls`) instead of a menu list of all | |
# executables: | |
function my-hg-report() { | |
tip=$(hg tip 2> /dev/null) || return | |
echo | |
hg --config pager.pager= status | |
echo | |
hg --config pager.pager= log --limit 5 --style compact |
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
import sys | |
import time | |
def reprint(msg): | |
"""Print msg from beginning of last line.""" | |
sys.stdout.write('\r') | |
sys.stdout.write(str(msg)) | |
sys.stdout.flush() | |
def watch(fn, update=0.25): |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
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
version: "2.1" | |
services: | |
prom: | |
image: prom/prometheus | |
environment: | |
- TZ=$TZ | |
volumes: | |
- ./prom.yml:/etc/prometheus/prometheus.yml | |
ports: |
NewerOlder