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
0eJzFfe3OHjdy7K0E/r0KZvg95wbORRwEgSy/8QqxPiDJuwmCvffzWJvdl3xbxanhVEt/Fl5ZZnH6aTab7Ori//z082+/P3389Pb9l5/+z7/8z09vvzy9e/xD96d/+pef3r758P7z40//3+Pfv//l6b8e/7g//vjz21/fv/7t63/25b8/Pv3xn339zx//6v3rd1///+vPn5/e/fzb2/e/vnr3+s2f375/ehV/+tvf/u3xV/7y9Onz2w/vH3+rtBpC24+thsefP73/8vbL26f/xfv44fPj/339a//z038//vfVXrZ/zY+/98csXsX2r/lv//iP/vvf3//+7uenT/87vX/M4dOHnz98/PDpy0+Pv/jNAXPtBqzfHjB0A/789tdXT789vfny6e2bVx8//PYERy77v27/HDn/6/atkWM38runX97+/m5h8FC/PXiSDA5mnpcH73/B8u3By+PPfnn76THc3//b/ks+/v7uI/41j87mYPDaD/b249OrLx9e/frpw+/vf8HDhvNh22zOHMzgMenbMMcE5um/Pn56+vz51QPj6dPfsV79/PTb12X8z0X6/uPvk9UQzmewbzen8OH3L7M5DFYIYA779zMDmkJwNkO/TjYwhyhZKGj0BRceLIfGzdqlEhrAmYURrZPAKVR3J+kj9be3w1lk+sccPn/87e2XL4+//6d/YP77IwP48Okx0tdt9O2vf55YonOmAMLjzgSuL59ev//8x3b9dztQeGB/Cnej1MmP384/ObwMUuHGJzfik19GpG/h3fjkSkxhFpAE/p4LYfYk9LRCfPPLcFbW8Yawhr6PCWvs92UCj4lhLF4i8Jh4xeJFAk8ZmcI5XmQi00pYAIlKZMLQnTXZz2EHc2BC08o3gxQjvoxDd/B6H4oA72XM+VYMuGPjfg4gL4+ztOqOHyM8ZRyKhB+/jENXbXyyvUXCjV+GphuhfsBDbvwyNN3B65bNfoAbg5ehSbRMd5Aep100ProB6ed/6Zai36jg6Mu3N/1vD38LJqQ |
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 collections | |
import json | |
import threading | |
from Queue import Queue | |
import _jsonnet as jsonnet | |
class LazyExecutor(threading.Thread): |
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
# Taken from streamlink | |
import re | |
from binascii import unhexlify | |
from collections import namedtuple | |
from itertools import starmap | |
from urlparse import urljoin, urlparse | |
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
// Render any jsonnet value (except functions) to TOML format. | |
local | |
inlineTable(body) = | |
"{" + | |
std.join(", ", ["%s = %s" % [escapeKeyToml(k), renderBody(body[k])] for k in std.objectFields(body)]) + | |
"}", | |
renderArray(body) = | |
local |
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 functools | |
import itertools | |
import sys | |
from collections import namedtuple | |
import argh | |
from ipaddress import IPv4Network | |
import easycmd |
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 os | |
import signal | |
import subprocess | |
class Timeout(Exception): | |
"""This is raised when a timeout occurs""" |
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 os | |
import random | |
import re | |
import sys | |
import argh | |
ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) |
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
#!/bin/bash | |
USAGE="$0 EXECUTABLE PATH | |
For all shared libraries used by EXECUTABLE, copy that .so file to PATH" | |
if [ "$#" -ne 2 ]; then | |
echo "$USAGE" >&2 | |
exit 1 | |
fi |
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
IDENTITY = lambda x: x | |
class Pool(object): | |
"""Implements a generic pool of resources. | |
The resource is an object that: | |
* is created by the given factory function / class | |
* is intended to be re-used | |
* is hashable and unique (ie. multiple calls to factory() won't return the same object) | |
* optionally, gets prepared for re-use by given clean_fn |
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
#!/bin/env python | |
import sys | |
from subprocess import check_call as cmd | |
from subprocess import check_output as cmd_out | |
from subprocess import CalledProcessError | |
out = cmd_out(['git', 'ls-remote', 'origin']) | |
refs = [line.split("\t") for line in out.strip().split("\n")] |