I hereby claim:
- I am objcode on github.
- I am objcode (https://keybase.io/objcode) on keybase.
- I have a public key whose fingerprint is 3BF6 CC06 3DE3 4DE7 9DA8 2213 7F4D BEDF 4134 143B
To claim this, I am signing this object:
class CachingInterface (object): | |
def __init__(self): | |
"To be overridden by the sub-class." | |
raise Exception("not implemented") | |
def store(key, value, type='post'): | |
""" | |
Store a key/value pair in the cache. Returns a Deferred. | |
import functools | |
class generatorfunction(object): | |
""" | |
Apparently you can't monkeypatch generator objects for some reason. | |
Lets go ahead and proxy them instead to add __call__. | |
""" | |
def __init__(self, generator): | |
self.delegate = generator |
import signal | |
class TimerException(Exception): pass | |
def timeout(signum, frame): | |
print "signal handler exception", signum | |
print frame | |
raise TimerException(frame) | |
signal.signal(signal.SIGALRM, timeout) |
import signal | |
import time | |
class TimerException(Exception): pass | |
from contextlib import contextmanager | |
@contextmanager | |
def signal_timer(mili): |
def shell(cmdline): | |
start = time.time() | |
outbuffer = StringIO.StringIO() | |
print "asked to shell", cmdline | |
subcommands = cmdline.split('|') | |
subcommands = [command.strip() for command in subcommands] | |
first, last, subcommands = subcommands[0], subcommands[-1], subcommands[1:-1] |
import gevent, gevent.event | |
import threading, Queue, collections, time, functools | |
def _threads_poller_f(): | |
while _OsThread._threads_count: | |
try: | |
t, rv, isexc = _OsThread._threads_results.get_nowait() | |
except Queue.Empty: | |
gevent.sleep() | |
else: |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
import csv | |
import sys | |
def process(fname, ofname): | |
with open(fname, 'rb') as csvfile: | |
with open(ofname, 'wb') as writefile: | |
out_lines = 0; | |
reader = csv.reader(csvfile) |
id,nces_id,state,school_name,school_website,prefix,firstname,lastname,title,email,source,worker | |
,370002502096,CA,Quality Education Academy,,Mr.,Joe,Alpha,Teacher,[email protected],, |
# A tiered light indicator is pretty easy to build and this will show you how to build scalable indicators using (2n + 1) decoders | |
# and one arithmetic. I made mine with three lights, which is enough to understand at a glance what's going on. | |
# | |
# You can also put the logic on the lights and use fewer deciders but I prefer this setup because it's easier to modify. | |
# | |
# Inputs: | |
# - R is a constant "ratio". It should be set to the integer value of (tank size - 1 / # of lights). | |
# - resource types | |
# | |
# Variables: |